Merge remote-tracking branch 'remotes/haiku/master' into package-management

This commit is contained in:
Ingo Weinhold
2013-07-11 18:09:03 +02:00
58 changed files with 963 additions and 397 deletions
+3 -3
View File
@@ -52,10 +52,10 @@
/*! /*!
\fn BGroupLayout::BGroupLayout(enum orientation orientation, float spacing) \fn BGroupLayout::BGroupLayout(orientation orientation, float spacing)
\brief Creates a new BGroupLayout. \brief Creates a new BGroupLayout.
\param orientation The #orientation of this BGroupLayout. \param orientation The orientation of this BGroupLayout.
\param spacing The spacing between BLayoutItems in this BGroupLayout. \param spacing The spacing between BLayoutItems in this BGroupLayout.
*/ */
@@ -95,7 +95,7 @@
/*! /*!
\fn void BGroupLayout::SetOrientation(enum orientation orientation) \fn void BGroupLayout::SetOrientation(orientation orientation)
\brief Set the #orientation of this BGroupLayout. \brief Set the #orientation of this BGroupLayout.
\param orientation The new #orientation of this BGroupLayout. \param orientation The new #orientation of this BGroupLayout.
*/ */
+3 -1
View File
@@ -528,10 +528,12 @@ topLayout->AddItem(nestedLayoutWithView);
/*! /*!
\fn void BLayout::LayoutInvalidated() = 0 \fn void BLayout::LayoutInvalidated(bool children)
Hook method called when this layout becomes invalid. This is a good place Hook method called when this layout becomes invalid. This is a good place
to clear any caches your object might hold. to clear any caches your object might hold.
\param children Whether or not child layouts have also been invalidated.
*/ */
+4 -8
View File
@@ -64,8 +64,7 @@
/*! /*!
\fn BLayoutBuilder::Group<ParentBuilder>::Group(BWindow *window, \fn BLayoutBuilder::Group<ParentBuilder>::Group(BWindow *window,
enum orientation orientation=B_HORIZONTAL, orientation orientation, float spacing)
float spacing=B_USE_DEFAULT_SPACING)
\brief Creates a new BGroupLayout, and attaches it to a BWindow. \brief Creates a new BGroupLayout, and attaches it to a BWindow.
\note The top BView* in \a window has its ViewColor set to \note The top BView* in \a window has its ViewColor set to
@@ -98,8 +97,7 @@
/*! /*!
\fn BLayoutBuilder::Group<ParentBuilder>::Group( \fn BLayoutBuilder::Group<ParentBuilder>::Group(
enum orientation orientation=B_HORIZONTAL, orientation orientation, float spacing)
float spacing=B_USE_DEFAULT_SPACING)
\brief Creates a new BGroupView and targets it. \brief Creates a new BGroupView and targets it.
Methods called on this builder will be directed to the new BGroupView's Methods called on this builder will be directed to the new BGroupView's
@@ -178,8 +176,7 @@
/*! /*!
\fn GroupBuilder BLayoutBuilder::Group<ParentBuilder>::AddGroup( \fn GroupBuilder BLayoutBuilder::Group<ParentBuilder>::AddGroup(
enum orientation orientation, float spacing=B_USE_DEFAULT_SPACING, orientation orientation, float spacing, float weight)
float weight=1.0f)
\brief Construct and add a viewless BGroupLayout, then return a GroupBuilder \brief Construct and add a viewless BGroupLayout, then return a GroupBuilder
representing the newly added layout. representing the newly added layout.
@@ -264,8 +261,7 @@
/*! /*!
\fn SplitBuilder BLayoutBuilder::Group<ParentBuilder>::AddSplit( \fn SplitBuilder BLayoutBuilder::Group<ParentBuilder>::AddSplit(
enum orientation orientation, float spacing=B_USE_DEFAULT_SPACING, orientation orientation, float spacing, float weight)
float weight=1.0f)
\brief Create and add a new BSplitView with a weight of \c weight, then \brief Create and add a new BSplitView with a weight of \c weight, then
return a SplitBuilder representing the new BSplitView. return a SplitBuilder representing the new BSplitView.
+5 -6
View File
@@ -147,7 +147,7 @@ public:
= B_ALIGN_HORIZONTAL_UNSET, = B_ALIGN_HORIZONTAL_UNSET,
int32 columnCount = 1, int32 rowCount = 1); int32 columnCount = 1, int32 rowCount = 1);
inline GroupBuilder AddGroup(enum orientation orientation, inline GroupBuilder AddGroup(orientation orientation,
float spacing, int32 column, int32 row, float spacing, int32 column, int32 row,
int32 columnCount = 1, int32 rowCount = 1); int32 columnCount = 1, int32 rowCount = 1);
inline GroupBuilder AddGroup(BGroupView* groupView, int32 column, inline GroupBuilder AddGroup(BGroupView* groupView, int32 column,
@@ -168,7 +168,7 @@ public:
int32 column, int32 row, int32 column, int32 row,
int32 columnCount = 1, int32 rowCount = 1); int32 columnCount = 1, int32 rowCount = 1);
inline SplitBuilder AddSplit(enum orientation orientation, inline SplitBuilder AddSplit(orientation orientation,
float spacing, int32 column, int32 row, float spacing, int32 column, int32 row,
int32 columnCount = 1, int32 rowCount = 1); int32 columnCount = 1, int32 rowCount = 1);
inline SplitBuilder AddSplit(BSplitView* splitView, int32 column, inline SplitBuilder AddSplit(BSplitView* splitView, int32 column,
@@ -197,8 +197,7 @@ public:
typedef Split<ThisBuilder> SplitBuilder; typedef Split<ThisBuilder> SplitBuilder;
public: public:
inline Split(enum orientation orientation inline Split(orientation orientation = B_HORIZONTAL,
= B_HORIZONTAL,
float spacing = 0.0f); float spacing = 0.0f);
inline Split(BSplitView* view); inline Split(BSplitView* view);
@@ -211,7 +210,7 @@ public:
inline ThisBuilder& Add(BLayoutItem* item); inline ThisBuilder& Add(BLayoutItem* item);
inline ThisBuilder& Add(BLayoutItem* item, float weight); inline ThisBuilder& Add(BLayoutItem* item, float weight);
inline GroupBuilder AddGroup(enum orientation orientation, inline GroupBuilder AddGroup(orientation orientation,
float spacing = 0.0f, float weight = 1.0f); float spacing = 0.0f, float weight = 1.0f);
inline GroupBuilder AddGroup(BGroupView* groupView, inline GroupBuilder AddGroup(BGroupView* groupView,
float weight = 1.0f); float weight = 1.0f);
@@ -226,7 +225,7 @@ public:
inline GridBuilder AddGrid(BGridLayout* gridLayout, inline GridBuilder AddGrid(BGridLayout* gridLayout,
float weight = 1.0f); float weight = 1.0f);
inline SplitBuilder AddSplit(enum orientation orientation, inline SplitBuilder AddSplit(orientation orientation,
float spacing = 0.0f, float weight = 1.0f); float spacing = 0.0f, float weight = 1.0f);
inline SplitBuilder AddSplit(BSplitView* splitView, inline SplitBuilder AddSplit(BSplitView* splitView,
float weight = 1.0f); float weight = 1.0f);
+1 -1
View File
@@ -67,7 +67,7 @@
/*! /*!
\fn void DrawItem(BView* owner, BRect frame, bool complete) \fn void BListItem::DrawItem(BView* owner, BRect frame, bool complete)
\brief Hook method called when the item is drawn. \brief Hook method called when the item is drawn.
\param owner The view that the list item is a child of. \param owner The view that the list item is a child of.
+5 -14
View File
@@ -267,17 +267,6 @@
*/ */
/*!
\fn void BListView::KeyUp(const char* bytes, int32 numBytes)
\brief Hook method that is called when a keyboard key is released.
\param bytes The \a bytes representing the keys released.
\param numBytes The size of \a bytes.
\see BView::KeyUp()
*/
/*! /*!
\fn void BListView::MouseDown(BPoint point) \fn void BListView::MouseDown(BPoint point)
\brief Hook method that is called when a mouse button is pushed down while \brief Hook method that is called when a mouse button is pushed down while
@@ -475,7 +464,7 @@
/*! /*!
\fn bool BListView::AddList(BList* list) \fn bool BListView::AddList(BList* list)
\fn Add a \a list of list items to the end of the list view. \brief Add a \a list of list items to the end of the list view.
\param list The \a list of list items to add. \param list The \a list of list items to add.
@@ -698,7 +687,7 @@
/*! /*!
\fn void BListView::DoForEach(bool (*func)(BListItem*)) \fn void BListView::DoForEach(bool (*func)(BListItem* item))
\brief Calls the specified function on each item in the list. \brief Calls the specified function on each item in the list.
The \a func is called on the items in order starting with the item at index 0 The \a func is called on the items in order starting with the item at index 0
@@ -712,7 +701,8 @@
/*! /*!
\fn void BListView::DoForEach(bool (*func)(BListItem*, void*), void* arg) \fn void BListView::DoForEach(bool (*func)(BListItem* item, void* arg),
void* arg)
\brief Calls the specified function on each item in the list. \brief Calls the specified function on each item in the list.
The \a func is called on the items in order starting with the item at index 0 The \a func is called on the items in order starting with the item at index 0
@@ -723,6 +713,7 @@
as the second argument. as the second argument.
\param func The function to call on each item. \param func The function to call on each item.
\param arg The second argument of the function.
*/ */
+7 -23
View File
@@ -398,7 +398,8 @@
set in the BTextView with the font and color formats set by \a runs. set in the BTextView with the font and color formats set by \a runs.
\param text The text to set. \param text The text to set.
\param runs The text styling to set, can be \c NULL. \param runs Set the font and color formats of the new text if provided. Only
applies if the BTextView permits multiple character formats.
*/ */
@@ -413,8 +414,9 @@
to 0 to clear the text from the BTextView. to 0 to clear the text from the BTextView.
\param text The text to set. \param text The text to set.
\param length The number of bytes of text to set. \param length The maximum number of bytes of \a text to use.
\param runs The text styling to use, can be \c NULL. \param runs Set the font and color formats of the new text if provided. Only
applies if the BTextView permits multiple character formats.
*/ */
@@ -428,7 +430,8 @@
\param file The file to set the text from. \param file The file to set the text from.
\param offset The position in the file to start reading text. \param offset The position in the file to start reading text.
\param length The number of bytes of text to read from the file. \param length The number of bytes of text to read from the file.
\param runs The text styling to use, can be \c NULL. \param runs Set the font and color formats of the new text if provided. Only
applies if the BTextView permits multiple character formats.
*/ */
@@ -489,25 +492,6 @@
*/ */
//! @{
/*!
\fn void BTextView::SetText(const char* text, const text_run_array* runs)
*/
/*!
\fn void BTextView::SetText(const char* text, int32 length,
const text_run_array* runs)
*/
/*!
\fn void BTextView::SetText(BFile* file, int32 offset, int32 length,
const text_run_array* runs)
*/
//! @} //! @}
+4 -4
View File
@@ -56,7 +56,7 @@
/*! /*!
\fn void BTwoDimensionalLayout::AlignLayoutWith( \fn void BTwoDimensionalLayout::AlignLayoutWith(
BTwoDimensionalLayout* other, enum orientation orientation) BTwoDimensionalLayout* other, orientation orientation)
\brief Align the BLayoutItem&apos;s in the specified \a orientation within \brief Align the BLayoutItem&apos;s in the specified \a orientation within
two or more BTwoDimensionalLayout&apos;s. two or more BTwoDimensionalLayout&apos;s.
@@ -114,7 +114,7 @@
/*! /*!
\fn void BTwoDimensionalLayout::PrepareItems(enum orientation orientation) \fn void BTwoDimensionalLayout::PrepareItems(orientation orientation)
\brief Prepare the BLayoutItem in this BTwoDimensionalLayout subclass \brief Prepare the BLayoutItem in this BTwoDimensionalLayout subclass
for layout within a certain \a orientation. for layout within a certain \a orientation.
@@ -158,8 +158,8 @@
/*! /*!
\fn void BTwoDimensionalLayout::GetColumnRowConstraints(enum orientation \fn void BTwoDimensionalLayout::GetColumnRowConstraints(
orientation, int32 index, ColumnRowConstraints* constraints) orientation orientation, int32 index, ColumnRowConstraints* constraints)
\brief Fill in the ColumnRowConstraints for a certain column or row in \brief Fill in the ColumnRowConstraints for a certain column or row in
the BTwoDimensionalLayout. the BTwoDimensionalLayout.
+1 -1
View File
@@ -40,7 +40,7 @@
So, let's review the BGroupLayout constructor: So, let's review the BGroupLayout constructor:
\code \code
BGroupLayout(enum orientation orientation, float spacing = B_USE_DEFAULT_SPACING) BGroupLayout(orientation orientation, float spacing = B_USE_DEFAULT_SPACING)
\endcode \endcode
Because we only have one item in this layout, \c orientation and \c spacing Because we only have one item in this layout, \c orientation and \c spacing
+66 -1
View File
@@ -324,6 +324,7 @@ struct pci_module_info {
#define PCI_ata 0x05 /* ATA controller with ADMA interface */ #define PCI_ata 0x05 /* ATA controller with ADMA interface */
#define PCI_sata 0x06 /* Serial ATA controller */ #define PCI_sata 0x06 /* Serial ATA controller */
#define PCI_sas 0x07 /* Serial Attached SCSI controller */ #define PCI_sas 0x07 /* Serial Attached SCSI controller */
#define PCI_nvm 0x08 /* NVM Express controller */
#define PCI_mass_storage_other 0x80 /* other mass storage controller */ #define PCI_mass_storage_other 0x80 /* other mass storage controller */
/* --- /* ---
@@ -335,6 +336,15 @@ struct pci_module_info {
#define PCI_sata_other 0x00 /* vendor specific interface */ #define PCI_sata_other 0x00 /* vendor specific interface */
#define PCI_sata_ahci 0x01 /* AHCI interface */ #define PCI_sata_ahci 0x01 /* AHCI interface */
/* ---
values of the class_api field for
class_base = 0x01 (mass storage)
class_sub = 0x08 (NVM Express controller)
--- */
#define PCI_nvm_other 0x00 /* vendor specific interface */
#define PCI_nvm_hci 0x01 /* NVMHCI interface 1.0 */
#define PCI_nvm_hci_enterprise 0x02 /* NVMHCI enterprise */
/* --- /* ---
values for the class_sub field for class_base = 0x02 (network) values for the class_sub field for class_base = 0x02 (network)
@@ -345,6 +355,8 @@ struct pci_module_info {
#define PCI_fddi 0x02 /* FDDI controller */ #define PCI_fddi 0x02 /* FDDI controller */
#define PCI_atm 0x03 /* ATM controller */ #define PCI_atm 0x03 /* ATM controller */
#define PCI_isdn 0x04 /* ISDN controller */ #define PCI_isdn 0x04 /* ISDN controller */
#define PCI_worldfip 0x05 /* WorldFip controller */
#define PCI_picmg 0x06 /* PICMG controller */
#define PCI_network_other 0x80 /* other network controller */ #define PCI_network_other 0x80 /* other network controller */
@@ -405,6 +417,8 @@ struct pci_module_info {
#define PCI_parallel 0x01 /* parallel port */ #define PCI_parallel 0x01 /* parallel port */
#define PCI_multiport_serial 0x02 /* multiport serial controller */ #define PCI_multiport_serial 0x02 /* multiport serial controller */
#define PCI_modem 0x03 /* modem */ #define PCI_modem 0x03 /* modem */
#define PCI_gpib 0x04 /* GPIB controller */
#define PCI_smart_card 0x05 /* Smard Card controller */
#define PCI_simple_communications_other 0x80 /* other communications device */ #define PCI_simple_communications_other 0x80 /* other communications device */
/* --- /* ---
@@ -439,6 +453,8 @@ struct pci_module_info {
#define PCI_timer 0x02 /* timers */ #define PCI_timer 0x02 /* timers */
#define PCI_rtc 0x03 /* real time clock */ #define PCI_rtc 0x03 /* real time clock */
#define PCI_generic_hot_plug 0x04 /* generic PCI hot-plug controller */ #define PCI_generic_hot_plug 0x04 /* generic PCI hot-plug controller */
#define PCI_sd_host 0x05 /* SD Host controller */
#define PCI_iommu 0x06 /* IOMMU */
#define PCI_system_peripheral_other 0x80 /* other generic system peripheral */ #define PCI_system_peripheral_other 0x80 /* other generic system peripheral */
/* --- /* ---
@@ -644,6 +660,8 @@ struct pci_module_info {
#define PCI_address_io_mask 0xFFFFFFFC /* mask to get i/o space base address */ #define PCI_address_io_mask 0xFFFFFFFC /* mask to get i/o space base address */
#define PCI_range_memory_mask 0xFFFFFFF0 /* mask to get memory ranges */
/* --- /* ---
masks for flags in expansion rom base address registers masks for flags in expansion rom base address registers
@@ -686,7 +704,7 @@ struct pci_module_info {
#define PCI_cap_id_msi 0x05 /* Message signalled interrupt */ #define PCI_cap_id_msi 0x05 /* Message signalled interrupt */
#define PCI_cap_id_chswp 0x06 /* Compact PCI HotSwap */ #define PCI_cap_id_chswp 0x06 /* Compact PCI HotSwap */
#define PCI_cap_id_pcix 0x07 /* PCI-X */ #define PCI_cap_id_pcix 0x07 /* PCI-X */
#define PCI_cap_id_ldt 0x08 #define PCI_cap_id_ht 0x08 /* HyperTransport */
#define PCI_cap_id_vendspec 0x09 #define PCI_cap_id_vendspec 0x09
#define PCI_cap_id_debugport 0x0a #define PCI_cap_id_debugport 0x0a
#define PCI_cap_id_cpci_rsrcctl 0x0b #define PCI_cap_id_cpci_rsrcctl 0x0b
@@ -773,6 +791,53 @@ struct pci_module_info {
#define PCI_msi_control_mmc_16 0x0008 #define PCI_msi_control_mmc_16 0x0008
#define PCI_msi_control_mmc_32 0x000a #define PCI_msi_control_mmc_32 0x000a
/** MSI-X registers **/
#define PCI_msix_control 0x02
#define PCI_msix_table 0x04
#define PCI_msix_pba 0x08
#define PCI_msix_control_table_size 0x07ff
#define PCI_msix_control_function_mask 0x4000
#define PCI_msix_control_enable 0x8000
#define PCI_msix_bir_mask 0x0007
#define PCI_msix_bir_0 0x10
#define PCI_msix_bir_1 0x14
#define PCI_msix_bir_2 0x18
#define PCI_msix_bir_3 0x1c
#define PCI_msix_bir_4 0x20
#define PCI_msix_bir_5 0x24
#define PCI_msix_offset_mask 0xfff8
#define PCI_msix_vctrl_mask 0x0001
/** HyperTransport registers **/
#define PCI_ht_command 0x02
#define PCI_ht_msi_address_low 0x04
#define PCI_ht_msi_address_high 0x08
#define PCI_ht_command_cap_mask_3_bits 0xe000
#define PCI_ht_command_cap_mask_5_bits 0xf800
#define PCI_ht_command_cap_slave 0x0000
#define PCI_ht_command_cap_host 0x2000
#define PCI_ht_command_cap_switch 0x4000
#define PCI_ht_command_cap_interrupt 0x8000
#define PCI_ht_command_cap_revision_id 0x8800
#define PCI_ht_command_cap_unit_id_clumping 0x9000
#define PCI_ht_command_cap_ext_config_space 0x9800
#define PCI_ht_command_cap_address_mapping 0xa000
#define PCI_ht_command_cap_msi_mapping 0xa800
#define PCI_ht_command_cap_direct_route 0xb000
#define PCI_ht_command_cap_vcset 0xb800
#define PCI_ht_command_cap_retry_mode 0xc000
#define PCI_ht_command_cap_x86_encoding 0xc800
#define PCI_ht_command_cap_gen3 0xd000
#define PCI_ht_command_cap_fle 0xd800
#define PCI_ht_command_cap_pm 0xe000
#define PCI_ht_command_cap_high_node_count 0xe800
#define PCI_ht_command_msi_enable 0x0001
#define PCI_ht_command_msi_fixed 0x0002
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
+27
View File
@@ -35,6 +35,33 @@ typedef struct pci_x86_module_info {
uint8 bus, /* bus number */ uint8 bus, /* bus number */
uint8 device, /* device # on bus */ uint8 device, /* device # on bus */
uint8 function); /* function # in device */ uint8 function); /* function # in device */
uint8 (*get_msix_count)(
uint8 bus, /* bus number */
uint8 device, /* device # on bus */
uint8 function); /* function # in device */
status_t (*configure_msix)(
uint8 bus, /* bus number */
uint8 device, /* device # on bus */
uint8 function, /* function # in device */
uint8 count, /* count of vectors desired */
uint8 *startVector); /* first configured vector */
status_t (*unconfigure_msix)(
uint8 bus, /* bus number */
uint8 device, /* device # on bus */
uint8 function); /* function # in device */
status_t (*enable_msix)(
uint8 bus, /* bus number */
uint8 device, /* device # on bus */
uint8 function); /* function # in device */
status_t (*disable_msix)(
uint8 bus, /* bus number */
uint8 device, /* device # on bus */
uint8 function); /* function # in device */
} pci_x86_module_info; } pci_x86_module_info;
#define B_PCI_X86_MODULE_NAME "bus_managers/pci/x86/v1" #define B_PCI_X86_MODULE_NAME "bus_managers/pci/x86/v1"
+3 -3
View File
@@ -19,14 +19,14 @@ public:
uint32 flags = B_WILL_DRAW); uint32 flags = B_WILL_DRAW);
BChannelSlider(BRect area, const char* name, BChannelSlider(BRect area, const char* name,
const char* label, BMessage* message, const char* label, BMessage* message,
enum orientation orientation, orientation orientation,
int32 channels = 1, int32 channels = 1,
uint32 resizeMode uint32 resizeMode
= B_FOLLOW_LEFT | B_FOLLOW_TOP, = B_FOLLOW_LEFT | B_FOLLOW_TOP,
uint32 flags = B_WILL_DRAW); uint32 flags = B_WILL_DRAW);
BChannelSlider(const char* name, BChannelSlider(const char* name,
const char* label, BMessage* message, const char* label, BMessage* message,
enum orientation orientation, orientation orientation,
int32 channels = 1, int32 channels = 1,
uint32 flags = B_WILL_DRAW); uint32 flags = B_WILL_DRAW);
BChannelSlider(BMessage* archive); BChannelSlider(BMessage* archive);
@@ -67,7 +67,7 @@ public:
virtual void SetEnabled(bool on); virtual void SetEnabled(bool on);
virtual orientation Orientation() const; virtual orientation Orientation() const;
void SetOrientation(enum orientation orientation); void SetOrientation(orientation orientation);
virtual int32 MaxChannelCount() const; virtual int32 MaxChannelCount() const;
virtual bool SupportsIndividualLimits() const; virtual bool SupportsIndividualLimits() const;
+19 -28
View File
@@ -119,16 +119,14 @@ public:
const rgb_color& base, const rgb_color& base,
uint32 flags = 0, uint32 flags = 0,
uint32 borders = B_ALL_BORDERS, uint32 borders = B_ALL_BORDERS,
enum orientation orientation orientation orientation = B_HORIZONTAL);
= B_HORIZONTAL);
/*virtual*/ void DrawButtonBackground(BView* view, BRect& rect, /*virtual*/ void DrawButtonBackground(BView* view, BRect& rect,
const BRect& updateRect, const BRect& updateRect,
float radius, float radius,
const rgb_color& base, const rgb_color& base,
uint32 flags = 0, uint32 flags = 0,
uint32 borders = B_ALL_BORDERS, uint32 borders = B_ALL_BORDERS,
enum orientation orientation orientation orientation = B_HORIZONTAL);
= B_HORIZONTAL);
/*virtual*/ void DrawButtonBackground(BView* view, BRect& rect, /*virtual*/ void DrawButtonBackground(BView* view, BRect& rect,
const BRect& updateRect, const BRect& updateRect,
float leftTopRadius, float leftTopRadius,
@@ -138,8 +136,7 @@ public:
const rgb_color& base, const rgb_color& base,
uint32 flags = 0, uint32 flags = 0,
uint32 borders = B_ALL_BORDERS, uint32 borders = B_ALL_BORDERS,
enum orientation orientation orientation orientation = B_HORIZONTAL);
= B_HORIZONTAL);
virtual void DrawMenuBarBackground(BView* view, BRect& rect, virtual void DrawMenuBarBackground(BView* view, BRect& rect,
const BRect& updateRect, const BRect& updateRect,
@@ -222,11 +219,11 @@ public:
BRect& rect1, BRect& rect2, BRect& rect1, BRect& rect2,
const BRect& updateRect, const BRect& updateRect,
const rgb_color& base, uint32 flags, const rgb_color& base, uint32 flags,
enum orientation orientation); orientation orientation);
virtual void DrawScrollBarBackground(BView* view, virtual void DrawScrollBarBackground(BView* view,
BRect& rect, const BRect& updateRect, BRect& rect, const BRect& updateRect,
const rgb_color& base, uint32 flags, const rgb_color& base, uint32 flags,
enum orientation orientation); orientation orientation);
/*virtual*/ void DrawScrollViewFrame(BView* view, /*virtual*/ void DrawScrollViewFrame(BView* view,
BRect& rect, const BRect& updateRect, BRect& rect, const BRect& updateRect,
@@ -251,32 +248,32 @@ public:
rgb_color leftFillColor, rgb_color leftFillColor,
rgb_color rightFillColor, rgb_color rightFillColor,
float sliderScale, uint32 flags, float sliderScale, uint32 flags,
enum orientation orientation); orientation orientation);
virtual void DrawSliderBar(BView* view, BRect rect, virtual void DrawSliderBar(BView* view, BRect rect,
const BRect& updateRect, const BRect& updateRect,
const rgb_color& base, rgb_color fillColor, const rgb_color& base, rgb_color fillColor,
uint32 flags, enum orientation orientation); uint32 flags, orientation orientation);
virtual void DrawSliderThumb(BView* view, BRect& rect, virtual void DrawSliderThumb(BView* view, BRect& rect,
const BRect& updateRect, const BRect& updateRect,
const rgb_color& base, uint32 flags, const rgb_color& base, uint32 flags,
enum orientation orientation); orientation orientation);
/*virtual*/ void DrawSliderTriangle(BView* view, BRect& rect, /*virtual*/ void DrawSliderTriangle(BView* view, BRect& rect,
const BRect& updateRect, const BRect& updateRect,
const rgb_color& base, uint32 flags, const rgb_color& base, uint32 flags,
enum orientation orientation); orientation orientation);
virtual void DrawSliderTriangle(BView* view, BRect& rect, virtual void DrawSliderTriangle(BView* view, BRect& rect,
const BRect& updateRect, const BRect& updateRect,
const rgb_color& base, const rgb_color& base,
const rgb_color& fill, uint32 flags, const rgb_color& fill, uint32 flags,
enum orientation orientation); orientation orientation);
virtual void DrawSliderHashMarks(BView* view, BRect& rect, virtual void DrawSliderHashMarks(BView* view, BRect& rect,
const BRect& updateRect, const BRect& updateRect,
const rgb_color& base, int32 count, const rgb_color& base, int32 count,
hash_mark_location location, hash_mark_location location,
uint32 flags, enum orientation orientation); uint32 flags, orientation orientation);
virtual void DrawActiveTab(BView* view, BRect& rect, virtual void DrawActiveTab(BView* view, BRect& rect,
const BRect& updateRect, const BRect& updateRect,
@@ -291,7 +288,7 @@ public:
/*virtual*/ void DrawSplitter(BView* view, BRect& rect, /*virtual*/ void DrawSplitter(BView* view, BRect& rect,
const BRect& updateRect, const BRect& updateRect,
const rgb_color& base, const rgb_color& base,
enum orientation orientation, orientation orientation,
uint32 flags = 0, uint32 flags = 0,
uint32 borders = B_ALL_BORDERS); uint32 borders = B_ALL_BORDERS);
@@ -381,8 +378,7 @@ protected:
const rgb_color& base, const rgb_color& base,
uint32 flags = 0, uint32 flags = 0,
uint32 borders = B_ALL_BORDERS, uint32 borders = B_ALL_BORDERS,
enum orientation orientation orientation orientation = B_HORIZONTAL);
= B_HORIZONTAL);
void _DrawMenuFieldBackgroundOutside(BView* view, void _DrawMenuFieldBackgroundOutside(BView* view,
BRect& rect, const BRect& updateRect, BRect& rect, const BRect& updateRect,
@@ -503,7 +499,7 @@ protected:
const rgb_color& fillShadowColor, const rgb_color& fillShadowColor,
float leftInset, float topInset, float leftInset, float topInset,
float rightInset, float bottomInset, float rightInset, float bottomInset,
enum orientation orientation); orientation orientation);
// Border color methods // Border color methods
rgb_color _EdgeLightColor(const rgb_color& base, rgb_color _EdgeLightColor(const rgb_color& base,
@@ -530,33 +526,28 @@ protected:
void _FillGradient(BView* view, const BRect& rect, void _FillGradient(BView* view, const BRect& rect,
const rgb_color& base, float topTint, const rgb_color& base, float topTint,
float bottomTint, float bottomTint,
enum orientation orientation orientation orientation = B_HORIZONTAL);
= B_HORIZONTAL);
void _FillGlossyGradient(BView* view, void _FillGlossyGradient(BView* view,
const BRect& rect, const rgb_color& base, const BRect& rect, const rgb_color& base,
float topTint, float middle1Tint, float topTint, float middle1Tint,
float middle2Tint, float bottomTint, float middle2Tint, float bottomTint,
enum orientation orientation orientation orientation = B_HORIZONTAL);
= B_HORIZONTAL);
void _MakeGradient(BGradientLinear& gradient, void _MakeGradient(BGradientLinear& gradient,
const BRect& rect, const rgb_color& base, const BRect& rect, const rgb_color& base,
float topTint, float bottomTint, float topTint, float bottomTint,
enum orientation orientation orientation orientation = B_HORIZONTAL) const;
= B_HORIZONTAL) const;
void _MakeGlossyGradient(BGradientLinear& gradient, void _MakeGlossyGradient(BGradientLinear& gradient,
const BRect& rect, const rgb_color& base, const BRect& rect, const rgb_color& base,
float topTint, float middle1Tint, float topTint, float middle1Tint,
float middle2Tint, float bottomTint, float middle2Tint, float bottomTint,
enum orientation orientation orientation orientation = B_HORIZONTAL) const;
= B_HORIZONTAL) const;
void _MakeButtonGradient(BGradientLinear& gradient, void _MakeButtonGradient(BGradientLinear& gradient,
BRect& rect, const rgb_color& base, BRect& rect, const rgb_color& base,
uint32 flags, enum orientation orientation uint32 flags, orientation orientation = B_HORIZONTAL) const;
= B_HORIZONTAL) const;
bool _RadioButtonAndCheckBoxMarkColor( bool _RadioButtonAndCheckBoxMarkColor(
const rgb_color& base, rgb_color& color, const rgb_color& base, rgb_color& color,
+1 -1
View File
@@ -80,7 +80,7 @@ protected:
virtual int32 InternalCountColumns(); virtual int32 InternalCountColumns();
virtual int32 InternalCountRows(); virtual int32 InternalCountRows();
virtual void GetColumnRowConstraints( virtual void GetColumnRowConstraints(
enum orientation orientation, orientation orientation,
int32 index, int32 index,
ColumnRowConstraints* constraints); ColumnRowConstraints* constraints);
virtual void GetItemDimensions(BLayoutItem* item, virtual void GetItemDimensions(BLayoutItem* item,
+4 -4
View File
@@ -9,7 +9,7 @@
class BGroupLayout : public BTwoDimensionalLayout { class BGroupLayout : public BTwoDimensionalLayout {
public: public:
BGroupLayout(enum orientation orientation, BGroupLayout(orientation orientation,
float spacing = B_USE_DEFAULT_SPACING); float spacing = B_USE_DEFAULT_SPACING);
BGroupLayout(BMessage* from); BGroupLayout(BMessage* from);
virtual ~BGroupLayout(); virtual ~BGroupLayout();
@@ -18,7 +18,7 @@ public:
void SetSpacing(float spacing); void SetSpacing(float spacing);
orientation Orientation() const; orientation Orientation() const;
void SetOrientation(enum orientation orientation); void SetOrientation(orientation orientation);
float ItemWeight(int32 index) const; float ItemWeight(int32 index) const;
void SetItemWeight(int32 index, float weight); void SetItemWeight(int32 index, float weight);
@@ -51,12 +51,12 @@ protected:
virtual bool ItemAdded(BLayoutItem* item, int32 atIndex); virtual bool ItemAdded(BLayoutItem* item, int32 atIndex);
virtual void ItemRemoved(BLayoutItem* item, int32 fromIndex); virtual void ItemRemoved(BLayoutItem* item, int32 fromIndex);
virtual void PrepareItems(enum orientation orientation); virtual void PrepareItems(orientation orientation);
virtual int32 InternalCountColumns(); virtual int32 InternalCountColumns();
virtual int32 InternalCountRows(); virtual int32 InternalCountRows();
virtual void GetColumnRowConstraints( virtual void GetColumnRowConstraints(
enum orientation orientation, orientation orientation,
int32 index, int32 index,
ColumnRowConstraints* constraints); ColumnRowConstraints* constraints);
virtual void GetItemDimensions(BLayoutItem* item, virtual void GetItemDimensions(BLayoutItem* item,
+2 -2
View File
@@ -12,7 +12,7 @@
class BGroupLayoutBuilder { class BGroupLayoutBuilder {
public: public:
BGroupLayoutBuilder( BGroupLayoutBuilder(
enum orientation orientation = B_HORIZONTAL, orientation orientation = B_HORIZONTAL,
float spacing = B_USE_DEFAULT_SPACING); float spacing = B_USE_DEFAULT_SPACING);
BGroupLayoutBuilder(BGroupLayout* layout); BGroupLayoutBuilder(BGroupLayout* layout);
BGroupLayoutBuilder(BGroupView* view); BGroupLayoutBuilder(BGroupView* view);
@@ -28,7 +28,7 @@ public:
BGroupLayoutBuilder& Add(BLayoutItem* item); BGroupLayoutBuilder& Add(BLayoutItem* item);
BGroupLayoutBuilder& Add(BLayoutItem* item, float weight); BGroupLayoutBuilder& Add(BLayoutItem* item, float weight);
BGroupLayoutBuilder& AddGroup(enum orientation orientation, BGroupLayoutBuilder& AddGroup(orientation orientation,
float spacing = B_USE_DEFAULT_SPACING, float spacing = B_USE_DEFAULT_SPACING,
float weight = 1.0f); float weight = 1.0f);
BGroupLayoutBuilder& End(); BGroupLayoutBuilder& End();
+2 -2
View File
@@ -13,10 +13,10 @@
class BGroupView : public BView { class BGroupView : public BView {
public: public:
BGroupView( BGroupView(
enum orientation orientation = B_HORIZONTAL, orientation orientation = B_HORIZONTAL,
float spacing = B_USE_DEFAULT_SPACING); float spacing = B_USE_DEFAULT_SPACING);
BGroupView(const char* name, BGroupView(const char* name,
enum orientation orientation = B_HORIZONTAL, orientation orientation = B_HORIZONTAL,
float spacing = B_USE_DEFAULT_SPACING); float spacing = B_USE_DEFAULT_SPACING);
BGroupView(BMessage* from); BGroupView(BMessage* from);
virtual ~BGroupView(); virtual ~BGroupView();
+27 -29
View File
@@ -55,14 +55,13 @@ public:
typedef Split<ThisBuilder> SplitBuilder; typedef Split<ThisBuilder> SplitBuilder;
public: public:
inline Group(enum orientation orientation inline Group(orientation orientation = B_HORIZONTAL,
= B_HORIZONTAL,
float spacing = B_USE_DEFAULT_SPACING); float spacing = B_USE_DEFAULT_SPACING);
inline Group(BWindow* window, inline Group(BWindow* window,
enum orientation orientation = B_HORIZONTAL, orientation orientation = B_HORIZONTAL,
float spacing = B_USE_DEFAULT_SPACING); float spacing = B_USE_DEFAULT_SPACING);
inline Group(BView* view, inline Group(BView* view,
enum orientation orientation = B_HORIZONTAL, orientation orientation = B_HORIZONTAL,
float spacing = B_USE_DEFAULT_SPACING); float spacing = B_USE_DEFAULT_SPACING);
inline Group(BGroupLayout* layout); inline Group(BGroupLayout* layout);
inline Group(BGroupView* view); inline Group(BGroupView* view);
@@ -77,7 +76,7 @@ public:
inline ThisBuilder& Add(BLayoutItem* item); inline ThisBuilder& Add(BLayoutItem* item);
inline ThisBuilder& Add(BLayoutItem* item, float weight); inline ThisBuilder& Add(BLayoutItem* item, float weight);
inline GroupBuilder AddGroup(enum orientation orientation, inline GroupBuilder AddGroup(orientation orientation,
float spacing = B_USE_DEFAULT_SPACING, float spacing = B_USE_DEFAULT_SPACING,
float weight = 1.0f); float weight = 1.0f);
inline GroupBuilder AddGroup(BGroupView* groupView, inline GroupBuilder AddGroup(BGroupView* groupView,
@@ -94,7 +93,7 @@ public:
inline GridBuilder AddGrid(BGridView* gridView, inline GridBuilder AddGrid(BGridView* gridView,
float weight = 1.0f); float weight = 1.0f);
inline SplitBuilder AddSplit(enum orientation orientation, inline SplitBuilder AddSplit(orientation orientation,
float spacing = B_USE_DEFAULT_SPACING, float spacing = B_USE_DEFAULT_SPACING,
float weight = 1.0f); float weight = 1.0f);
inline SplitBuilder AddSplit(BSplitView* splitView, inline SplitBuilder AddSplit(BSplitView* splitView,
@@ -165,7 +164,7 @@ public:
int32 textColumnCount = 1, int32 textColumnCount = 1,
int32 rowCount = 1); int32 rowCount = 1);
inline GroupBuilder AddGroup(enum orientation orientation, inline GroupBuilder AddGroup(orientation orientation,
float spacing, int32 column, int32 row, float spacing, int32 column, int32 row,
int32 columnCount = 1, int32 rowCount = 1); int32 columnCount = 1, int32 rowCount = 1);
inline GroupBuilder AddGroup(BGroupView* groupView, int32 column, inline GroupBuilder AddGroup(BGroupView* groupView, int32 column,
@@ -186,7 +185,7 @@ public:
int32 column, int32 row, int32 column, int32 row,
int32 columnCount = 1, int32 rowCount = 1); int32 columnCount = 1, int32 rowCount = 1);
inline SplitBuilder AddSplit(enum orientation orientation, inline SplitBuilder AddSplit(orientation orientation,
float spacing, int32 column, int32 row, float spacing, int32 column, int32 row,
int32 columnCount = 1, int32 rowCount = 1); int32 columnCount = 1, int32 rowCount = 1);
inline SplitBuilder AddSplit(BSplitView* splitView, int32 column, inline SplitBuilder AddSplit(BSplitView* splitView, int32 column,
@@ -225,8 +224,7 @@ public:
typedef Split<ThisBuilder> SplitBuilder; typedef Split<ThisBuilder> SplitBuilder;
public: public:
inline Split(enum orientation orientation inline Split(orientation orientation = B_HORIZONTAL,
= B_HORIZONTAL,
float spacing = B_USE_DEFAULT_SPACING); float spacing = B_USE_DEFAULT_SPACING);
inline Split(BSplitView* view); inline Split(BSplitView* view);
@@ -239,7 +237,7 @@ public:
inline ThisBuilder& Add(BLayoutItem* item); inline ThisBuilder& Add(BLayoutItem* item);
inline ThisBuilder& Add(BLayoutItem* item, float weight); inline ThisBuilder& Add(BLayoutItem* item, float weight);
inline GroupBuilder AddGroup(enum orientation orientation, inline GroupBuilder AddGroup(orientation orientation,
float spacing = B_USE_DEFAULT_SPACING, float spacing = B_USE_DEFAULT_SPACING,
float weight = 1.0f); float weight = 1.0f);
inline GroupBuilder AddGroup(BGroupView* groupView, inline GroupBuilder AddGroup(BGroupView* groupView,
@@ -256,7 +254,7 @@ public:
inline GridBuilder AddGrid(BGridLayout* gridLayout, inline GridBuilder AddGrid(BGridLayout* gridLayout,
float weight = 1.0f); float weight = 1.0f);
inline SplitBuilder AddSplit(enum orientation orientation, inline SplitBuilder AddSplit(orientation orientation,
float spacing = B_USE_DEFAULT_SPACING, float spacing = B_USE_DEFAULT_SPACING,
float weight = 1.0f); float weight = 1.0f);
inline SplitBuilder AddSplit(BSplitView* splitView, inline SplitBuilder AddSplit(BSplitView* splitView,
@@ -358,7 +356,7 @@ Base<ParentBuilder>::End()
template<typename ParentBuilder> template<typename ParentBuilder>
Group<ParentBuilder>::Group(enum orientation orientation, float spacing) Group<ParentBuilder>::Group(orientation orientation, float spacing)
: :
fLayout((new BGroupView(orientation, spacing))->GroupLayout()) fLayout((new BGroupView(orientation, spacing))->GroupLayout())
{ {
@@ -366,8 +364,8 @@ Group<ParentBuilder>::Group(enum orientation orientation, float spacing)
template<typename ParentBuilder> template<typename ParentBuilder>
Group<ParentBuilder>::Group(BWindow* window, enum orientation orientation, Group<ParentBuilder>::Group(BWindow* window, orientation orientation,
float spacing) float spacing)
: :
fLayout(new BGroupLayout(orientation, spacing)) fLayout(new BGroupLayout(orientation, spacing))
{ {
@@ -379,8 +377,8 @@ Group<ParentBuilder>::Group(BWindow* window, enum orientation orientation,
template<typename ParentBuilder> template<typename ParentBuilder>
Group<ParentBuilder>::Group(BView* view, enum orientation orientation, Group<ParentBuilder>::Group(BView* view, orientation orientation,
float spacing) float spacing)
: :
fLayout(new BGroupLayout(orientation, spacing)) fLayout(new BGroupLayout(orientation, spacing))
{ {
@@ -478,8 +476,8 @@ Group<ParentBuilder>::Add(BLayoutItem* item, float weight)
template<typename ParentBuilder> template<typename ParentBuilder>
typename Group<ParentBuilder>::GroupBuilder typename Group<ParentBuilder>::GroupBuilder
Group<ParentBuilder>::AddGroup(enum orientation orientation, float spacing, Group<ParentBuilder>::AddGroup(orientation orientation, float spacing,
float weight) float weight)
{ {
GroupBuilder builder(new BGroupLayout(orientation, spacing)); GroupBuilder builder(new BGroupLayout(orientation, spacing));
builder.SetParent(this); builder.SetParent(this);
@@ -546,8 +544,8 @@ Group<ParentBuilder>::AddGrid(BGridView* gridView, float weight)
template<typename ParentBuilder> template<typename ParentBuilder>
typename Group<ParentBuilder>::SplitBuilder typename Group<ParentBuilder>::SplitBuilder
Group<ParentBuilder>::AddSplit(enum orientation orientation, float spacing, Group<ParentBuilder>::AddSplit(orientation orientation, float spacing,
float weight) float weight)
{ {
SplitBuilder builder(orientation, spacing); SplitBuilder builder(orientation, spacing);
builder.SetParent(this); builder.SetParent(this);
@@ -800,8 +798,8 @@ Grid<ParentBuilder>::AddTextControl(BTextControl* textControl, int32 column,
template<typename ParentBuilder> template<typename ParentBuilder>
typename Grid<ParentBuilder>::GroupBuilder typename Grid<ParentBuilder>::GroupBuilder
Grid<ParentBuilder>::AddGroup(enum orientation orientation, float spacing, Grid<ParentBuilder>::AddGroup(orientation orientation, float spacing,
int32 column, int32 row, int32 columnCount, int32 rowCount) int32 column, int32 row, int32 columnCount, int32 rowCount)
{ {
GroupBuilder builder(new BGroupLayout(orientation, spacing)); GroupBuilder builder(new BGroupLayout(orientation, spacing));
builder.SetParent(this); builder.SetParent(this);
@@ -860,7 +858,7 @@ Grid<ParentBuilder>::AddGrid(BGridView* gridView, int32 column, int32 row,
template<typename ParentBuilder> template<typename ParentBuilder>
typename Grid<ParentBuilder>::SplitBuilder typename Grid<ParentBuilder>::SplitBuilder
Grid<ParentBuilder>::AddSplit(enum orientation orientation, float spacing, Grid<ParentBuilder>::AddSplit(orientation orientation, float spacing,
int32 column, int32 row, int32 columnCount, int32 rowCount) int32 column, int32 row, int32 columnCount, int32 rowCount)
{ {
SplitBuilder builder(orientation, spacing); SplitBuilder builder(orientation, spacing);
@@ -986,7 +984,7 @@ Grid<ParentBuilder>::operator BGridLayout*()
template<typename ParentBuilder> template<typename ParentBuilder>
Split<ParentBuilder>::Split(enum orientation orientation, float spacing) Split<ParentBuilder>::Split(orientation orientation, float spacing)
: :
fView(new BSplitView(orientation, spacing)) fView(new BSplitView(orientation, spacing))
{ {
@@ -1065,8 +1063,8 @@ Split<ParentBuilder>::Add(BLayoutItem* item, float weight)
template<typename ParentBuilder> template<typename ParentBuilder>
typename Split<ParentBuilder>::GroupBuilder typename Split<ParentBuilder>::GroupBuilder
Split<ParentBuilder>::AddGroup(enum orientation orientation, float spacing, Split<ParentBuilder>::AddGroup(orientation orientation, float spacing,
float weight) float weight)
{ {
GroupBuilder builder(new BGroupLayout(orientation, spacing)); GroupBuilder builder(new BGroupLayout(orientation, spacing));
builder.SetParent(this); builder.SetParent(this);
@@ -1133,8 +1131,8 @@ Split<ParentBuilder>::AddGrid(BGridLayout* layout, float weight)
template<typename ParentBuilder> template<typename ParentBuilder>
typename Split<ParentBuilder>::SplitBuilder typename Split<ParentBuilder>::SplitBuilder
Split<ParentBuilder>::AddSplit(enum orientation orientation, float spacing, Split<ParentBuilder>::AddSplit(orientation orientation, float spacing,
float weight) float weight)
{ {
SplitBuilder builder(orientation, spacing); SplitBuilder builder(orientation, spacing);
builder.SetParent(this); builder.SetParent(this);
+2 -2
View File
@@ -26,7 +26,7 @@ public:
orientation direction); orientation direction);
BScrollBar(const char* name, BView* target, BScrollBar(const char* name, BView* target,
float min, float max, float min, float max,
enum orientation orientation); orientation orientation);
BScrollBar(BMessage* archive); BScrollBar(BMessage* archive);
virtual ~BScrollBar(); virtual ~BScrollBar();
static BArchivable* Instantiate(BMessage* archive); static BArchivable* Instantiate(BMessage* archive);
@@ -48,7 +48,7 @@ public:
void SetTarget(BView *target); void SetTarget(BView *target);
void SetTarget(const char* targetName); void SetTarget(const char* targetName);
BView* Target() const; BView* Target() const;
void SetOrientation(enum orientation orientation); void SetOrientation(orientation orientation);
orientation Orientation() const; orientation Orientation() const;
// TODO: Make this a virtual method, it should be one, // TODO: Make this a virtual method, it should be one,
+7 -11
View File
@@ -13,34 +13,30 @@
class BSeparatorView : public BView { class BSeparatorView : public BView {
public: public:
BSeparatorView(enum orientation orientation, BSeparatorView(orientation orientation,
border_style border = B_PLAIN_BORDER); border_style border = B_PLAIN_BORDER);
BSeparatorView(const char* name, BSeparatorView(const char* name,
const char* label, const char* label,
enum orientation orientation orientation orientation = B_HORIZONTAL,
= B_HORIZONTAL,
border_style border = B_FANCY_BORDER, border_style border = B_FANCY_BORDER,
const BAlignment& alignment const BAlignment& alignment
= BAlignment(B_ALIGN_HORIZONTAL_CENTER, = BAlignment(B_ALIGN_HORIZONTAL_CENTER,
B_ALIGN_VERTICAL_CENTER)); B_ALIGN_VERTICAL_CENTER));
BSeparatorView(const char* name, BSeparatorView(const char* name,
BView* labelView, BView* labelView,
enum orientation orientation orientation orientation = B_HORIZONTAL,
= B_HORIZONTAL,
border_style border = B_FANCY_BORDER, border_style border = B_FANCY_BORDER,
const BAlignment& alignment const BAlignment& alignment
= BAlignment(B_ALIGN_HORIZONTAL_CENTER, = BAlignment(B_ALIGN_HORIZONTAL_CENTER,
B_ALIGN_VERTICAL_CENTER)); B_ALIGN_VERTICAL_CENTER));
BSeparatorView(const char* label = NULL, BSeparatorView(const char* label = NULL,
enum orientation orientation orientation orientation = B_HORIZONTAL,
= B_HORIZONTAL,
border_style border = B_FANCY_BORDER, border_style border = B_FANCY_BORDER,
const BAlignment& alignment const BAlignment& alignment
= BAlignment(B_ALIGN_HORIZONTAL_CENTER, = BAlignment(B_ALIGN_HORIZONTAL_CENTER,
B_ALIGN_VERTICAL_CENTER)); B_ALIGN_VERTICAL_CENTER));
BSeparatorView(BView* labelView, BSeparatorView(BView* labelView,
enum orientation orientation orientation orientation = B_HORIZONTAL,
= B_HORIZONTAL,
border_style border = B_FANCY_BORDER, border_style border = B_FANCY_BORDER,
const BAlignment& alignment const BAlignment& alignment
= BAlignment(B_ALIGN_HORIZONTAL_CENTER, = BAlignment(B_ALIGN_HORIZONTAL_CENTER,
@@ -61,7 +57,7 @@ public:
virtual BSize MaxSize(); virtual BSize MaxSize();
virtual BSize PreferredSize(); virtual BSize PreferredSize();
void SetOrientation(enum orientation orientation); void SetOrientation(orientation orientation);
void SetAlignment(const BAlignment& aligment); void SetAlignment(const BAlignment& aligment);
void SetBorderStyle(border_style border); void SetBorderStyle(border_style border);
@@ -88,7 +84,7 @@ private:
private: private:
void _Init(const char* label, BView* labelView, void _Init(const char* label, BView* labelView,
enum orientation orientation, orientation orientation,
BAlignment alignment, border_style border); BAlignment alignment, border_style border);
float _BorderSize() const; float _BorderSize() const;
+1 -1
View File
@@ -10,7 +10,7 @@
class BSplitLayoutBuilder { class BSplitLayoutBuilder {
public: public:
BSplitLayoutBuilder( BSplitLayoutBuilder(
enum orientation orientation = B_HORIZONTAL, orientation orientation = B_HORIZONTAL,
float spacing = B_USE_DEFAULT_SPACING); float spacing = B_USE_DEFAULT_SPACING);
BSplitLayoutBuilder(BSplitView* view); BSplitLayoutBuilder(BSplitView* view);
+4 -5
View File
@@ -13,8 +13,7 @@ class BSplitLayout;
class BSplitView : public BView { class BSplitView : public BView {
public: public:
BSplitView( BSplitView(
enum orientation orientation orientation orientation = B_HORIZONTAL,
= B_HORIZONTAL,
float spacing = B_USE_DEFAULT_SPACING); float spacing = B_USE_DEFAULT_SPACING);
BSplitView(BMessage* from); BSplitView(BMessage* from);
virtual ~BSplitView(); virtual ~BSplitView();
@@ -30,7 +29,7 @@ public:
void SetSpacing(float spacing); void SetSpacing(float spacing);
orientation Orientation() const; orientation Orientation() const;
void SetOrientation(enum orientation orientation); void SetOrientation(orientation orientation);
float SplitterSize() const; float SplitterSize() const;
void SetSplitterSize(float size); void SetSplitterSize(float size);
@@ -86,7 +85,7 @@ protected:
virtual void DrawSplitter(BRect frame, virtual void DrawSplitter(BRect frame,
const BRect& updateRect, const BRect& updateRect,
enum orientation orientation, orientation orientation,
bool pressed); bool pressed);
private: private:
@@ -109,7 +108,7 @@ private:
static void _DrawDefaultSplitter(BView* view, BRect frame, static void _DrawDefaultSplitter(BView* view, BRect frame,
const BRect& updateRect, const BRect& updateRect,
enum orientation orientation, orientation orientation,
bool pressed); bool pressed);
private: private:
+3 -3
View File
@@ -25,7 +25,7 @@ public:
float* bottom) const; float* bottom) const;
void AlignLayoutWith(BTwoDimensionalLayout* other, void AlignLayoutWith(BTwoDimensionalLayout* other,
enum orientation orientation); orientation orientation);
virtual BSize BaseMinSize(); virtual BSize BaseMinSize();
virtual BSize BaseMaxSize(); virtual BSize BaseMaxSize();
@@ -72,14 +72,14 @@ protected:
float* preferredHeight); float* preferredHeight);
BSize SubtractInsets(BSize size); BSize SubtractInsets(BSize size);
virtual void PrepareItems(enum orientation orientation); virtual void PrepareItems(orientation orientation);
virtual bool HasMultiColumnItems(); virtual bool HasMultiColumnItems();
virtual bool HasMultiRowItems(); virtual bool HasMultiRowItems();
virtual int32 InternalCountColumns() = 0; virtual int32 InternalCountColumns() = 0;
virtual int32 InternalCountRows() = 0; virtual int32 InternalCountRows() = 0;
virtual void GetColumnRowConstraints( virtual void GetColumnRowConstraints(
enum orientation orientation, orientation orientation,
int32 index, int32 index,
ColumnRowConstraints* constraints) = 0; ColumnRowConstraints* constraints) = 0;
virtual void GetItemDimensions(BLayoutItem* item, virtual void GetItemDimensions(BLayoutItem* item,
+39 -37
View File
@@ -62,43 +62,45 @@ enum radeon_chipset {
RADEON_RS690, RADEON_RS690,
RADEON_RS740, RADEON_RS740,
RADEON_RV515, RADEON_RV515,
RADEON_R520, //r500, Radeon X1300-X1950 RADEON_R520, //r500, DCE 1.0
RADEON_RV530, RADEON_RV530, // DCE 1.0
RADEON_RV560, RADEON_RV560, // DCE 1.0
RADEON_RV570, RADEON_RV570, // DCE 1.0
RADEON_R580, RADEON_R580, // DCE 1.0
RADEON_R600, //r600, Radeon HD 2000, 3000 RADEON_R600, //r600, DCE 2.0
RADEON_RV610, RADEON_RV610, // DCE 2.0
RADEON_RV630, RADEON_RV630, // DCE 2.0
RADEON_RV670, RADEON_RV670, // DCE 2.0
RADEON_RV620, RADEON_RV620, // DCE 3.0
RADEON_RV635, RADEON_RV635, // DCE 3.0
RADEON_RS780, RADEON_RS780, // DCE 3.0
RADEON_RS880, RADEON_RS880, // DCE 3.0
RADEON_RV770, //r700, Radeon HD 4000 RADEON_RV770, //r700, DCE 3.1
RADEON_RV730, RADEON_RV730, // DCE 3.2
RADEON_RV710, RADEON_RV710, // DCE 3.2
RADEON_RV740, RADEON_RV740, // DCE 3.2
RADEON_CEDAR, //Evergreen, Radeon HD 5000 RADEON_CEDAR, //Evergreen, DCE 4.0
RADEON_REDWOOD, RADEON_REDWOOD, // DCE 4.0
RADEON_JUNIPER, RADEON_JUNIPER, // DCE 4.0
RADEON_CYPRESS, RADEON_CYPRESS, // DCE 4.0
RADEON_HEMLOCK, RADEON_HEMLOCK, // DCE 4.0?
RADEON_PALM, //Fusion APU (NI), Radeon HD 6000 RADEON_PALM, //Fusion APU (NI), DCE 4.1
RADEON_SUMO, RADEON_SUMO, // DCE 4.1
RADEON_SUMO2, RADEON_SUMO2, // DCE 4.1
RADEON_CAICOS, //Nothern Islands, Radeon HD 6000 / Low end 7000 RADEON_CAICOS, //Nothern Islands, DCE 5.0
RADEON_TURKS, RADEON_TURKS, // DCE 5.0
RADEON_BARTS, RADEON_BARTS, // DCE 5.0
RADEON_CAYMAN, RADEON_CAYMAN, // DCE 5.0
RADEON_ANTILLES, RADEON_ANTILLES, // DCE 5.0?
RADEON_CAPEVERDE, //Southern Islands, Radeon HD 7000 aka ARUBA RADEON_CAPEVERDE, //Southern Islands, DCE 6.0
RADEON_BONAIRE, RADEON_PITCAIRN, // DCE 6.0
RADEON_PITCAIRN, RADEON_TAHITI, // DCE 6.0
RADEON_TAHITI, RADEON_ARUBA, // DCE 6.1 Trinity/Richland
RADEON_OLAND, //Sea Islands, Radeon HD 8000 RADEON_OLAND, // DCE 6.4
RADEON_HAINAN, // NO DCE? RADEON_HAINAN, // NO DCE
RADEON_CURACAO, RADEON_KAVERI, //Sea Islands, DCE 8.1
RADEON_BONAIRE, // DCE 8.2
RADEON_KABINI, // DCE 8.3
}; };
@@ -9,4 +9,6 @@ void
pci_read_arch_info(PCIDev *dev) pci_read_arch_info(PCIDev *dev)
{ {
pci_read_msi_info(dev); pci_read_msi_info(dev);
pci_read_msix_info(dev);
pci_read_ht_mapping_info(dev);
} }
@@ -9,6 +9,8 @@
typedef struct pci_arch_info { typedef struct pci_arch_info {
msi_info msi; msi_info msi;
msix_info msix;
ht_mapping_info ht_mapping;
} pci_arch_info; } pci_arch_info;
@@ -42,5 +42,10 @@ pci_x86_module_info gPCIArchModule = {
&pci_configure_msi, &pci_configure_msi,
&pci_unconfigure_msi, &pci_unconfigure_msi,
&pci_enable_msi, &pci_enable_msi,
&pci_disable_msi &pci_disable_msi,
&pci_get_msix_count,
&pci_configure_msix,
&pci_unconfigure_msix,
&pci_enable_msix,
&pci_disable_msix
}; };
@@ -1,4 +1,5 @@
/* /*
* Copyright 2013, Jérôme Duval, korli@users.berlios.de.
* Copyright 2010, Michael Lotz, mmlr@mlotz.ch. All Rights Reserved. * Copyright 2010, Michael Lotz, mmlr@mlotz.ch. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
@@ -14,6 +15,60 @@
extern PCI *gPCI; extern PCI *gPCI;
static void
pci_ht_msi_map(PCIDev *device, uint64 address)
{
ht_mapping_info *info = &device->arch_info.ht_mapping;
if (!info->ht_mapping_capable)
return;
bool enabled = (info->control_value & PCI_ht_command_msi_enable) != 0;
if ((address != 0) != enabled) {
if (enabled) {
info->control_value &= ~PCI_ht_command_msi_enable;
} else {
if ((address >> 20) != (info->address_value >> 20))
return;
dprintf("ht msi mapping enabled\n");
info->control_value |= PCI_ht_command_msi_enable;
}
gPCI->WriteConfig(device, info->capability_offset + PCI_ht_command,
info->control_value, 2);
}
}
void
pci_read_ht_mapping_info(PCIDev *device)
{
if (!msi_supported())
return;
ht_mapping_info *info = &device->arch_info.ht_mapping;
info->ht_mapping_capable = false;
uint8 offset = 0;
if (gPCI->FindHTCapability(device, PCI_ht_command_cap_msi_mapping,
&offset) == B_OK) {
info->control_value = gPCI->ReadConfig(device, offset + PCI_ht_command,
2);
info->capability_offset = offset;
info->ht_mapping_capable = true;
if ((info->control_value & PCI_ht_command_msi_fixed) != 0)
info->address_value = MSI_ADDRESS_BASE;
else {
info->address_value = gPCI->ReadConfig(device, offset
+ PCI_ht_msi_address_high, 4);
info->address_value <<= 32;
info->address_value |= gPCI->ReadConfig(device, offset
+ PCI_ht_msi_address_low, 4);
}
dprintf("found an ht msi mapping at %#" B_PRIx64 "\n",
info->address_value);
}
}
uint8 uint8
pci_get_msi_count(uint8 virtualBus, uint8 _device, uint8 function) pci_get_msi_count(uint8 virtualBus, uint8 _device, uint8 function)
{ {
@@ -163,6 +218,9 @@ pci_enable_msi(uint8 virtualBus, uint8 _device, uint8 function)
gPCI->WriteConfig(device, info->capability_offset + PCI_msi_control, 2, gPCI->WriteConfig(device, info->capability_offset + PCI_msi_control, 2,
info->control_value); info->control_value);
// enable HT msi mapping (if applicable)
pci_ht_msi_map(device, info->address_value);
dprintf("msi enabled: 0x%04" B_PRIx32 "\n", dprintf("msi enabled: 0x%04" B_PRIx32 "\n",
gPCI->ReadConfig(device, info->capability_offset + PCI_msi_control, 2)); gPCI->ReadConfig(device, info->capability_offset + PCI_msi_control, 2));
return B_OK; return B_OK;
@@ -192,6 +250,9 @@ pci_disable_msi(uint8 virtualBus, uint8 _device, uint8 function)
if (info->configured_count == 0) if (info->configured_count == 0)
return B_NO_INIT; return B_NO_INIT;
// disable HT msi mapping (if applicable)
pci_ht_msi_map(device, 0);
// disable msi generation // disable msi generation
info->control_value &= ~PCI_msi_control_enable; info->control_value &= ~PCI_msi_control_enable;
gPCI->WriteConfig(device, info->capability_offset + PCI_msi_control, 2, gPCI->WriteConfig(device, info->capability_offset + PCI_msi_control, 2,
@@ -225,3 +286,282 @@ pci_read_msi_info(PCIDev *device)
info->data_value = 0; info->data_value = 0;
info->address_value = 0; info->address_value = 0;
} }
uint8
pci_get_msix_count(uint8 virtualBus, uint8 _device, uint8 function)
{
if (!msi_supported())
return 0;
uint8 bus;
uint8 domain;
if (gPCI->ResolveVirtualBus(virtualBus, &domain, &bus) != B_OK)
return 0;
PCIDev *device = gPCI->FindDevice(domain, bus, _device, function);
if (device == NULL)
return 0;
msix_info *info = &device->arch_info.msix;
if (!info->msix_capable)
return 0;
return info->message_count;
}
status_t
pci_configure_msix(uint8 virtualBus, uint8 _device, uint8 function,
uint8 count, uint8 *startVector)
{
if (!msi_supported())
return B_UNSUPPORTED;
if (count == 0 || startVector == NULL)
return B_BAD_VALUE;
uint8 bus;
uint8 domain;
status_t result = gPCI->ResolveVirtualBus(virtualBus, &domain, &bus);
if (result != B_OK)
return result;
PCIDev *device = gPCI->FindDevice(domain, bus, _device, function);
if (device == NULL)
return B_ERROR;
msix_info *info = &device->arch_info.msix;
if (!info->msix_capable)
return B_UNSUPPORTED;
if (count > 32 || count > info->message_count) {
return B_BAD_VALUE;
}
if (info->configured_count != 0)
return B_BUSY;
// map the table bar
size_t tableSize = info->message_count * 16;
addr_t address;
area_id area = map_physical_memory("msi table map",
device->info.u.h0.base_registers[info->table_bar],
tableSize + info->table_offset,
B_ANY_KERNEL_ADDRESS, B_READ_AREA | B_WRITE_AREA, (void**)&address);
if (area < 0)
return area;
info->table_area_id = area;
info->table_address = address + info->table_offset;
// and the pba bar if necessary
if (info->table_bar != info->pba_bar) {
area = map_physical_memory("msi pba map",
device->info.u.h0.base_registers[info->pba_bar],
tableSize + info->pba_offset,
B_ANY_KERNEL_ADDRESS, B_READ_AREA | B_WRITE_AREA,
(void**)&address);
if (area < 0) {
delete_area(info->table_area_id);
info->table_area_id = -1;
return area;
}
info->pba_area_id = area;
} else
info->pba_area_id = -1;
info->pba_address = address + info->pba_offset;
result = msi_allocate_vectors(count, &info->start_vector,
&info->address_value, &info->data_value);
if (result != B_OK) {
delete_area(info->pba_area_id);
delete_area(info->table_area_id);
info->pba_area_id = -1;
info->table_area_id = -1;
return result;
}
// ensure the memory i/o is enabled
gPCI->WriteConfig(device, PCI_command, 2,
gPCI->ReadConfig(device, PCI_command, 2) | PCI_command_memory);
uint32 data_value = info->data_value;
for (uint32 index = 0; index < count; index++) {
volatile uint32 *entry = (uint32*)(info->table_address + 16 * index);
*(entry + 3) |= PCI_msix_vctrl_mask;
*entry++ = info->address_value & 0xffffffff;
*entry++ = info->address_value >> 32;
*entry++ = data_value++;
*entry &= ~PCI_msix_vctrl_mask;
}
info->configured_count = count;
*startVector = info->start_vector;
dprintf("msix configured for %d vectors\n", count);
return B_OK;
}
status_t
pci_unconfigure_msix(uint8 virtualBus, uint8 _device, uint8 function)
{
if (!msi_supported())
return B_UNSUPPORTED;
uint8 bus;
uint8 domain;
status_t result = gPCI->ResolveVirtualBus(virtualBus, &domain, &bus);
if (result != B_OK)
return result;
PCIDev *device = gPCI->FindDevice(domain, bus, _device, function);
if (device == NULL)
return B_ERROR;
msix_info *info = &device->arch_info.msix;
if (!info->msix_capable)
return B_UNSUPPORTED;
if (info->configured_count == 0)
return B_NO_INIT;
// disable msi-x generation
info->control_value &= ~PCI_msix_control_enable;
gPCI->WriteConfig(device, info->capability_offset + PCI_msix_control, 2,
info->control_value);
msi_free_vectors(info->configured_count, info->start_vector);
for (uint8 index = 0; index < info->configured_count; index++) {
volatile uint32 *entry = (uint32*)(info->table_address + 16 * index);
if ((*(entry + 3) & PCI_msix_vctrl_mask) == 0)
*(entry + 3) |= PCI_msix_vctrl_mask;
}
if (info->pba_area_id != -1)
delete_area(info->pba_area_id);
if (info->table_area_id != -1)
delete_area(info->table_area_id);
info->pba_area_id= -1;
info->table_area_id = -1;
info->configured_count = 0;
info->address_value = 0;
info->data_value = 0;
return B_OK;
}
status_t
pci_enable_msix(uint8 virtualBus, uint8 _device, uint8 function)
{
if (!msi_supported())
return B_UNSUPPORTED;
uint8 bus;
uint8 domain;
status_t result = gPCI->ResolveVirtualBus(virtualBus, &domain, &bus);
if (result != B_OK)
return result;
PCIDev *device = gPCI->FindDevice(domain, bus, _device, function);
if (device == NULL)
return B_ERROR;
msix_info *info = &device->arch_info.msix;
if (!info->msix_capable)
return B_UNSUPPORTED;
if (info->configured_count == 0)
return B_NO_INIT;
// ensure the pinned interrupt is disabled
gPCI->WriteConfig(device, PCI_command, 2,
gPCI->ReadConfig(device, PCI_command, 2) | PCI_command_int_disable);
// enable msi-x generation
info->control_value |= PCI_msix_control_enable;
gPCI->WriteConfig(device, info->capability_offset + PCI_msix_control, 2,
info->control_value);
// enable HT msi mapping (if applicable)
pci_ht_msi_map(device, info->address_value);
dprintf("msi-x enabled: 0x%04" B_PRIx32 "\n",
gPCI->ReadConfig(device, info->capability_offset + PCI_msix_control, 2));
return B_OK;
}
status_t
pci_disable_msix(uint8 virtualBus, uint8 _device, uint8 function)
{
if (!msi_supported())
return B_UNSUPPORTED;
uint8 bus;
uint8 domain;
status_t result = gPCI->ResolveVirtualBus(virtualBus, &domain, &bus);
if (result != B_OK)
return result;
PCIDev *device = gPCI->FindDevice(domain, bus, _device, function);
if (device == NULL)
return B_ERROR;
msix_info *info = &device->arch_info.msix;
if (!info->msix_capable)
return B_UNSUPPORTED;
if (info->configured_count == 0)
return B_NO_INIT;
// disable HT msi mapping (if applicable)
pci_ht_msi_map(device, 0);
// disable msi-x generation
info->control_value &= ~PCI_msix_control_enable;
gPCI->WriteConfig(device, info->capability_offset + PCI_msix_control, 2,
info->control_value);
return B_OK;
}
void
pci_read_msix_info(PCIDev *device)
{
if (!msi_supported())
return;
msix_info *info = &device->arch_info.msix;
info->msix_capable = false;
status_t result = gPCI->FindCapability(device->domain, device->bus,
device->device, device->function, PCI_cap_id_msix,
&info->capability_offset);
if (result != B_OK)
return;
info->msix_capable = true;
info->control_value = gPCI->ReadConfig(device->domain, device->bus,
device->device, device->function,
info->capability_offset + PCI_msix_control, 2);
info->message_count
= (info->control_value & PCI_msix_control_table_size) + 1;
info->configured_count = 0;
info->data_value = 0;
info->address_value = 0;
info->table_area_id = -1;
info->pba_area_id = -1;
uint32 table_value = gPCI->ReadConfig(device->domain, device->bus,
device->device, device->function,
info->capability_offset + PCI_msix_table, 4);
uint32 pba_value = gPCI->ReadConfig(device->domain, device->bus,
device->device, device->function,
info->capability_offset + PCI_msix_pba, 4);
info->table_bar = table_value & PCI_msix_bir_mask;
info->table_offset = table_value & PCI_msix_offset_mask;
info->pba_bar = pba_value & PCI_msix_bir_mask;
info->pba_offset = pba_value & PCI_msix_offset_mask;
}
@@ -1,15 +1,21 @@
/* /*
* Copyright 2013, Jérôme Duval, korli@users.berlios.de.
* Copyright 2010, Michael Lotz, mmlr@mlotz.ch. All Rights Reserved. * Copyright 2010, Michael Lotz, mmlr@mlotz.ch. All Rights Reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef _PCI_x86_MSI_H #ifndef _PCI_x86_MSI_H
#define _PCI_x86_MSI_H #define _PCI_x86_MSI_H
#include <OS.h>
#include <SupportDefs.h> #include <SupportDefs.h>
// Message Signaled Interrupts
class PCIDev; class PCIDev;
// Message Signaled Interrupts // MSI
typedef struct msi_info { typedef struct msi_info {
bool msi_capable; bool msi_capable;
uint8 capability_offset; uint8 capability_offset;
@@ -30,4 +36,46 @@ status_t pci_enable_msi(uint8 virtualBus, uint8 device, uint8 function);
status_t pci_disable_msi(uint8 virtualBus, uint8 device, uint8 function); status_t pci_disable_msi(uint8 virtualBus, uint8 device, uint8 function);
void pci_read_msi_info(PCIDev *device); void pci_read_msi_info(PCIDev *device);
// MSI-X
typedef struct msix_info {
bool msix_capable;
uint8 capability_offset;
uint8 message_count;
uint8 table_bar;
uint32 table_offset;
area_id table_area_id;
addr_t table_address;
uint8 pba_bar;
uint32 pba_offset;
area_id pba_area_id;
addr_t pba_address;
uint8 configured_count;
uint8 start_vector;
uint16 control_value;
uint16 data_value;
uint64 address_value;
} msix_info;
uint8 pci_get_msix_count(uint8 virtualBus, uint8 _device, uint8 function);
status_t pci_configure_msix(uint8 virtualBus, uint8 _device, uint8 function,
uint8 count, uint8 *startVector);
status_t pci_unconfigure_msix(uint8 virtualBus, uint8 device, uint8 function);
status_t pci_enable_msix(uint8 virtualBus, uint8 _device, uint8 function);
status_t pci_disable_msix(uint8 virtualBus, uint8 _device, uint8 function);
void pci_read_msix_info(PCIDev *device);
// HyperTransport MSI mapping
typedef struct ht_mapping_info {
bool ht_mapping_capable;
uint8 capability_offset;
uint16 control_value;
uint64 address_value;
} ht_mapping_info;
void pci_read_ht_mapping_info(PCIDev *device);
#endif // _PCI_x86_MSI_H #endif // _PCI_x86_MSI_H
@@ -1668,6 +1668,60 @@ PCI::FindExtendedCapability(PCIDev *device, uint16 capID, uint16 *offset)
} }
status_t
PCI::FindHTCapability(uint8 domain, uint8 bus, uint8 device,
uint8 function, uint16 capID, uint8 *offset)
{
uint8 capPointer;
// consider the passed offset as the current ht capability block pointer
// when it's non zero
if (offset != NULL && *offset != 0) {
capPointer = ReadConfig(domain, bus, device, function, *offset + 1,
1);
} else if (FindCapability(domain, bus, device, function, PCI_cap_id_ht,
&capPointer) != B_OK) {
FLOW("PCI:FindHTCapability ERROR %u:%u:%u capability %#02x "
"not supported\n", bus, device, function, capID);
return B_NAME_NOT_FOUND;
}
uint16 mask = PCI_ht_command_cap_mask_5_bits;
if (capID == PCI_ht_command_cap_slave || capID == PCI_ht_command_cap_host)
mask = PCI_ht_command_cap_mask_3_bits;
for (int i = 0; i < 48; i++) {
capPointer &= ~3;
if (capPointer == 0)
return B_NAME_NOT_FOUND;
uint8 capability = ReadConfig(domain, bus, device, function,
capPointer, 1);
if (capability == PCI_cap_id_ht) {
if ((ReadConfig(domain, bus, device, function,
capPointer + PCI_ht_command, 2) & mask) == capID) {
if (offset != NULL)
*offset = capPointer;
return B_OK;
}
}
capPointer = ReadConfig(domain, bus, device, function, capPointer + 1,
1);
}
TRACE_CAP("PCI:FindHTCapability ERROR %u:%u:%u capability %#04x "
"circular list\n", bus, device, function, capID);
return B_ERROR;
}
status_t
PCI::FindHTCapability(PCIDev *device, uint16 capID, uint8 *offset)
{
return FindHTCapability(device->domain, device->bus, device->device,
device->function, capID, offset);
}
PCIDev * PCIDev *
PCI::FindDevice(uint8 domain, uint8 bus, uint8 device, uint8 function) PCI::FindDevice(uint8 domain, uint8 bus, uint8 device, uint8 function)
{ {
+6 -1
View File
@@ -100,7 +100,12 @@ public:
uint16 *offset = NULL); uint16 *offset = NULL);
status_t FindExtendedCapability(PCIDev *device, status_t FindExtendedCapability(PCIDev *device,
uint16 capID, uint16 *offset = NULL); uint16 capID, uint16 *offset = NULL);
status_t FindHTCapability(uint8 domain, uint8 bus,
uint8 device, uint8 function, uint16 capID,
uint8 *offset);
status_t FindHTCapability(PCIDev *device,
uint16 capID, uint8 *offset = NULL);
status_t ResolveVirtualBus(uint8 virtualBus, uint8 *domain, status_t ResolveVirtualBus(uint8 virtualBus, uint8 *domain,
uint8 *bus); uint8 *bus);
@@ -310,8 +310,8 @@ get_capability_name(uint8 cap_id)
return "CompactPCIHotSwap"; return "CompactPCIHotSwap";
case PCI_cap_id_pcix: case PCI_cap_id_pcix:
return "PCI-X"; return "PCI-X";
case PCI_cap_id_ldt: case PCI_cap_id_ht:
return "ldt"; return "HyperTransport";
case PCI_cap_id_vendspec: case PCI_cap_id_vendspec:
return "vendspec"; return "vendspec";
case PCI_cap_id_debugport: case PCI_cap_id_debugport:
@@ -160,8 +160,9 @@ const struct supported_device {
{0x9460, 3, 1, RADEON_RV770, CHIP_STD, "Radeon HD 4890"}, {0x9460, 3, 1, RADEON_RV770, CHIP_STD, "Radeon HD 4890"},
// From here on AMD no longer used numeric identifiers // From here on AMD no longer used numeric identifiers
// Marketing names can collide for different generations of cards
// as such we should ignore them at all costs (besides the card name)
// Marketing Names: Radeon HD 5450 - HD 6320
// Introduced: 2009 // Introduced: 2009
// Codename: Evergreen // Codename: Evergreen
// Process: 40 nm // Process: 40 nm
@@ -210,7 +211,6 @@ const struct supported_device {
{0x9644, 4, 1, RADEON_SUMO2, CHIP_APU, "Radeon HD 6410D"}, {0x9644, 4, 1, RADEON_SUMO2, CHIP_APU, "Radeon HD 6410D"},
{0x9645, 4, 1, RADEON_SUMO2, CHIP_APU, "Radeon HD SUMO2 M"}, {0x9645, 4, 1, RADEON_SUMO2, CHIP_APU, "Radeon HD SUMO2 M"},
// Radeon HD 6450 - HD 7670
// Introduced: 2010 // Introduced: 2010
// Codename: Nothern Islands // Codename: Nothern Islands
// Process: 40 nm // Process: 40 nm
@@ -268,11 +268,11 @@ const struct supported_device {
// Antilles (Top, Dual GPU) // Antilles (Top, Dual GPU)
{0x671d, 5, 0, RADEON_ANTILLES, CHIP_STD, "Radeon HD 6990"}, {0x671d, 5, 0, RADEON_ANTILLES, CHIP_STD, "Radeon HD 6990"},
// Marketing Names: Radeon HD 7750 - HD 79xx
// Introduced: Late 2011 // Introduced: Late 2011
// Codename: Southern Islands // Codename: Southern Islands
// Process: 28 nm // Process: 28 nm
// Cape Verde (TODO: Need to find friendly names) // Cape Verde
{0x6820, 6, 0, RADEON_CAPEVERDE, CHIP_STD, "Radeon HD Verde"}, {0x6820, 6, 0, RADEON_CAPEVERDE, CHIP_STD, "Radeon HD Verde"},
{0x6821, 6, 0, RADEON_CAPEVERDE, CHIP_STD, "Radeon HD Verde"}, {0x6821, 6, 0, RADEON_CAPEVERDE, CHIP_STD, "Radeon HD Verde"},
{0x6823, 6, 0, RADEON_CAPEVERDE, CHIP_STD, "Radeon HD Verde"}, {0x6823, 6, 0, RADEON_CAPEVERDE, CHIP_STD, "Radeon HD Verde"},
@@ -292,14 +292,7 @@ const struct supported_device {
{0x683b, 6, 0, RADEON_CAPEVERDE, CHIP_STD, "Radeon HD Verde"}, {0x683b, 6, 0, RADEON_CAPEVERDE, CHIP_STD, "Radeon HD Verde"},
{0x683f, 6, 0, RADEON_CAPEVERDE, CHIP_STD, "Radeon HD 7750"}, {0x683f, 6, 0, RADEON_CAPEVERDE, CHIP_STD, "Radeon HD 7750"},
{0x683d, 6, 0, RADEON_CAPEVERDE, CHIP_STD, "Radeon HD 7770"}, {0x683d, 6, 0, RADEON_CAPEVERDE, CHIP_STD, "Radeon HD 7770"},
// Bonaire (TODO: Need to find friendly names) // Pitcairn
{0x6649, 6, 0, RADEON_BONAIRE, CHIP_STD, "Radeon HD Bonaire"},
{0x6650, 6, 0, RADEON_BONAIRE, CHIP_STD, "Radeon HD Bonaire"},
{0x6651, 6, 0, RADEON_BONAIRE, CHIP_STD, "Radeon HD Bonaire"},
{0x6658, 6, 0, RADEON_BONAIRE, CHIP_STD, "Radeon HD Bonaire"},
{0x665c, 6, 0, RADEON_BONAIRE, CHIP_STD, "Radeon HD 7790"},
{0x665d, 6, 0, RADEON_BONAIRE, CHIP_STD, "Radeon HD Bonaire"},
// Pitcairn (TODO: Need to find friendly names)
{0x6800, 6, 0, RADEON_PITCAIRN, CHIP_MOBILE, "Radeon HD 7970"}, {0x6800, 6, 0, RADEON_PITCAIRN, CHIP_MOBILE, "Radeon HD 7970"},
{0x6801, 6, 0, RADEON_PITCAIRN, CHIP_STD, "Radeon HD Pitcairn"}, {0x6801, 6, 0, RADEON_PITCAIRN, CHIP_STD, "Radeon HD Pitcairn"},
{0x6802, 6, 0, RADEON_PITCAIRN, CHIP_STD, "Radeon HD Pitcairn"}, {0x6802, 6, 0, RADEON_PITCAIRN, CHIP_STD, "Radeon HD Pitcairn"},
@@ -309,7 +302,7 @@ const struct supported_device {
{0x6818, 6, 0, RADEON_PITCAIRN, CHIP_STD, "Radeon HD 7870"}, {0x6818, 6, 0, RADEON_PITCAIRN, CHIP_STD, "Radeon HD 7870"},
{0x6819, 6, 0, RADEON_PITCAIRN, CHIP_STD, "Radeon HD 7800"}, {0x6819, 6, 0, RADEON_PITCAIRN, CHIP_STD, "Radeon HD 7800"},
{0x684c, 6, 0, RADEON_PITCAIRN, CHIP_STD, "Radeon HD Pitcairn"}, {0x684c, 6, 0, RADEON_PITCAIRN, CHIP_STD, "Radeon HD Pitcairn"},
// Tahiti (TODO: Need to find friendly names) // Tahiti
{0x6780, 6, 0, RADEON_TAHITI, CHIP_STD, "Radeon HD Tahiti"}, {0x6780, 6, 0, RADEON_TAHITI, CHIP_STD, "Radeon HD Tahiti"},
{0x6784, 6, 0, RADEON_TAHITI, CHIP_STD, "Radeon HD Tahiti"}, {0x6784, 6, 0, RADEON_TAHITI, CHIP_STD, "Radeon HD Tahiti"},
{0x6788, 6, 0, RADEON_TAHITI, CHIP_STD, "Radeon HD Tahiti"}, {0x6788, 6, 0, RADEON_TAHITI, CHIP_STD, "Radeon HD Tahiti"},
@@ -320,21 +313,27 @@ const struct supported_device {
{0x679a, 6, 0, RADEON_TAHITI, CHIP_STD, "Radeon HD 7950"}, {0x679a, 6, 0, RADEON_TAHITI, CHIP_STD, "Radeon HD 7950"},
{0x6798, 6, 0, RADEON_TAHITI, CHIP_STD, "Radeon HD 7970"}, {0x6798, 6, 0, RADEON_TAHITI, CHIP_STD, "Radeon HD 7970"},
{0x6799, 6, 0, RADEON_TAHITI, CHIP_STD, "Radeon HD 7990"}, {0x6799, 6, 0, RADEON_TAHITI, CHIP_STD, "Radeon HD 7990"},
// Aruba DCE 6.1 Trinity / Richland
// Oland DCE 6,4
// Hainan NODCE. No display hardware, OpenCL 3D engine.
// Marketing Names: Radeon HD 83xx - HD 89xx
// Introduced: Late 2013 // Introduced: Late 2013
// Codename: Sea Islands // Codename: Sea Islands
// Process: 28 nm // Process: 28 nm
// Oland DCE 6,4 // Kaveri DCE 8.1
// Hainan NO DCE? // Bonaire DCE 8.2
// Curacao ???? {0x6649, 8, 2, RADEON_BONAIRE, CHIP_STD, "Radeon HD Bonaire"},
{0x6650, 8, 2, RADEON_BONAIRE, CHIP_STD, "Radeon HD Bonaire"},
{0x6651, 8, 2, RADEON_BONAIRE, CHIP_STD, "Radeon HD Bonaire"},
{0x6658, 8, 2, RADEON_BONAIRE, CHIP_STD, "Radeon HD Bonaire"},
{0x665c, 8, 2, RADEON_BONAIRE, CHIP_STD, "Radeon HD 7790"},
{0x665d, 8, 2, RADEON_BONAIRE, CHIP_STD, "Radeon HD Bonaire"},
// Kabini DCE 8.3
// Marketing Names: Radeon HD 9xxx - HD 9xxx
// Introduced: 2014? // Introduced: 2014?
// Codename: Volcanic Islands // Codename: Volcanic Islands
// Process: 20 nm // Process: 20 nm
// Marketing Names: Radeon HD 9xxx - HD 9xxx
// Introduced: 2015? // Introduced: 2015?
// Codename: Pirate Islands // Codename: Pirate Islands
// Process: ?? nm // Process: ?? nm
@@ -30,7 +30,8 @@ enum {
MSG_SET_STOP_FOR_CUSTOM_IMAGES = 'sfci', MSG_SET_STOP_FOR_CUSTOM_IMAGES = 'sfci',
MSG_IMAGE_NAME_SELECTION_CHANGED = 'insc', MSG_IMAGE_NAME_SELECTION_CHANGED = 'insc',
MSG_ADD_IMAGE_NAME = 'anin', MSG_ADD_IMAGE_NAME = 'anin',
MSG_REMOVE_IMAGE_NAME = 'arin' MSG_REMOVE_IMAGE_NAME = 'arin',
MSG_IMAGE_NAME_INPUT_CHANGED = 'inic'
}; };
@@ -43,13 +44,6 @@ static int SortStringItems(const void* a, const void* b)
} }
static bool UpdateItemState(BListItem* item, void* enabled)
{
item->SetEnabled((bool)enabled);
return false;
}
BreakConditionConfigWindow::BreakConditionConfigWindow(::Team* team, BreakConditionConfigWindow::BreakConditionConfigWindow(::Team* team,
UserInterfaceListener* listener, BHandler* target) UserInterfaceListener* listener, BHandler* target)
: :
@@ -57,6 +51,8 @@ BreakConditionConfigWindow::BreakConditionConfigWindow(::Team* team,
B_AUTO_UPDATE_SIZE_LIMITS | B_CLOSE_ON_ESCAPE), B_AUTO_UPDATE_SIZE_LIMITS | B_CLOSE_ON_ESCAPE),
fTeam(team), fTeam(team),
fListener(listener), fListener(listener),
fExceptionSettingsBox(NULL),
fImageSettingsBox(NULL),
fExceptionThrown(NULL), fExceptionThrown(NULL),
fExceptionCaught(NULL), fExceptionCaught(NULL),
fStopOnImageLoad(NULL), fStopOnImageLoad(NULL),
@@ -65,6 +61,8 @@ BreakConditionConfigWindow::BreakConditionConfigWindow(::Team* team,
fStopImageNameInput(NULL), fStopImageNameInput(NULL),
fAddImageNameButton(NULL), fAddImageNameButton(NULL),
fRemoveImageNameButton(NULL), fRemoveImageNameButton(NULL),
fCustomImageGroup(NULL),
fStopOnLoadEnabled(false),
fUseCustomImages(false), fUseCustomImages(false),
fCloseButton(NULL), fCloseButton(NULL),
fTarget(target) fTarget(target)
@@ -116,19 +114,17 @@ BreakConditionConfigWindow::MessageReceived(BMessage* message)
case MSG_SET_STOP_FOR_ALL_IMAGES: case MSG_SET_STOP_FOR_ALL_IMAGES:
{ {
fUseCustomImages = false;
fListener->SetStopOnImageLoadRequested( fListener->SetStopOnImageLoadRequested(
fStopOnImageLoad->Value() == B_CONTROL_ON, fStopOnImageLoad->Value() == B_CONTROL_ON,
fUseCustomImages); false);
break; break;
} }
case MSG_SET_STOP_FOR_CUSTOM_IMAGES: case MSG_SET_STOP_FOR_CUSTOM_IMAGES:
{ {
fUseCustomImages = true;
fListener->SetStopOnImageLoadRequested( fListener->SetStopOnImageLoadRequested(
fStopOnImageLoad->Value() == B_CONTROL_ON, fStopOnImageLoad->Value() == B_CONTROL_ON,
fUseCustomImages); true);
break; break;
} }
@@ -142,6 +138,14 @@ BreakConditionConfigWindow::MessageReceived(BMessage* message)
break; break;
} }
case MSG_IMAGE_NAME_INPUT_CHANGED:
{
BString imageName(fStopImageNameInput->Text());
imageName.Trim();
fAddImageNameButton->SetEnabled(!imageName.IsEmpty());
break;
}
case MSG_STOP_ON_IMAGE_LOAD: case MSG_STOP_ON_IMAGE_LOAD:
{ {
fListener->SetStopOnImageLoadRequested( fListener->SetStopOnImageLoadRequested(
@@ -152,13 +156,14 @@ BreakConditionConfigWindow::MessageReceived(BMessage* message)
case MSG_STOP_IMAGE_SETTINGS_CHANGED: case MSG_STOP_IMAGE_SETTINGS_CHANGED:
{ {
_UpdateStopImageButtons(); _UpdateStopImageState();
break; break;
} }
case MSG_ADD_IMAGE_NAME: case MSG_ADD_IMAGE_NAME:
{ {
BString imageName(fStopImageNameInput->Text()); BString imageName(fStopImageNameInput->Text());
imageName.Trim();
AutoLocker< ::Team> teamLocker(fTeam); AutoLocker< ::Team> teamLocker(fTeam);
if (fTeam->StopImageNames().HasString(imageName)) if (fTeam->StopImageNames().HasString(imageName))
break; break;
@@ -268,18 +273,16 @@ BreakConditionConfigWindow::StopOnImageLoadNameRemoved(
void void
BreakConditionConfigWindow::_Init() BreakConditionConfigWindow::_Init()
{ {
BBox* exceptionSettingsBox = new BBox("exceptionBox"); fExceptionSettingsBox = new BBox("exceptionBox");
exceptionSettingsBox->SetLabel("Exceptions"); fExceptionSettingsBox->SetLabel("Exceptions");
exceptionSettingsBox->AddChild(BLayoutBuilder::Group<>() fExceptionSettingsBox->AddChild(BLayoutBuilder::Group<>(B_VERTICAL,
.AddGroup(B_VERTICAL) B_USE_DEFAULT_SPACING)
.SetInsets(B_USE_DEFAULT_SPACING) .Add(fExceptionThrown = new BCheckBox("exceptionThrown",
.Add(fExceptionThrown = new BCheckBox("exceptionThrown", "Stop when an exception is thrown",
"Stop when an exception is thrown", new BMessage(MSG_STOP_ON_THROWN_EXCEPTION_CHANGED)))
new BMessage(MSG_STOP_ON_THROWN_EXCEPTION_CHANGED))) .Add(fExceptionCaught = new BCheckBox("exceptionCaught",
.Add(fExceptionCaught = new BCheckBox("exceptionCaught", "Stop when an exception is caught",
"Stop when an exception is caught", new BMessage(MSG_STOP_ON_CAUGHT_EXCEPTION_CHANGED)))
new BMessage(MSG_STOP_ON_CAUGHT_EXCEPTION_CHANGED)))
.End()
.View()); .View());
fExceptionThrown->SetTarget(this); fExceptionThrown->SetTarget(this);
@@ -289,8 +292,8 @@ BreakConditionConfigWindow::_Init()
fExceptionCaught->SetEnabled(false); fExceptionCaught->SetEnabled(false);
BBox* imageSettingsBox = new BBox("imageBox"); fImageSettingsBox = new BBox("imageBox");
imageSettingsBox->SetLabel("Images"); fImageSettingsBox->SetLabel("Images");
BMenu* stopImageMenu = new BMenu("stopImageTypesMenu"); BMenu* stopImageMenu = new BMenu("stopImageTypesMenu");
stopImageMenu->AddItem(new BMenuItem("All", stopImageMenu->AddItem(new BMenuItem("All",
@@ -303,26 +306,28 @@ BreakConditionConfigWindow::_Init()
fStopImageNames->SetSelectionMessage( fStopImageNames->SetSelectionMessage(
new BMessage(MSG_IMAGE_NAME_SELECTION_CHANGED)); new BMessage(MSG_IMAGE_NAME_SELECTION_CHANGED));
imageSettingsBox->AddChild(BLayoutBuilder::Group<>() fCustomImageGroup = new BGroupView();
.AddGroup(B_VERTICAL) BLayoutBuilder::Group<>(fCustomImageGroup, B_VERTICAL, 0.0)
.SetInsets(B_USE_DEFAULT_SPACING) .Add(new BScrollView("stopImageScroll", fStopImageNames,
.Add(fStopOnImageLoad = new BCheckBox("stopOnImage", 0, false, true))
"Stop when an image is loaded", .Add(fStopImageNameInput = new BTextControl("stopImageName",
new BMessage(MSG_STOP_ON_IMAGE_LOAD))) "Image:", NULL, NULL))
.Add(fStopImageConstraints = new BMenuField( .AddGroup(B_HORIZONTAL)
"stopTypes", "Types:", stopImageMenu)) .AddGlue()
.Add(new BScrollView("stopImageScroll", fStopImageNames, .Add(fAddImageNameButton = new BButton("Add",
0, false, true)) new BMessage(MSG_ADD_IMAGE_NAME)))
.Add(fStopImageNameInput = new BTextControl("stopImageName", .Add(fRemoveImageNameButton = new BButton("Remove",
"Image:", NULL, NULL)) new BMessage(MSG_REMOVE_IMAGE_NAME)))
.AddGroup(B_HORIZONTAL) .End();
.AddGlue()
.Add(fAddImageNameButton = new BButton("Add", fImageSettingsBox->AddChild(BLayoutBuilder::Group<>(B_VERTICAL)
new BMessage(MSG_ADD_IMAGE_NAME))) .SetInsets(B_USE_DEFAULT_SPACING)
.Add(fRemoveImageNameButton = new BButton("Remove", .Add(fStopOnImageLoad = new BCheckBox("stopOnImage",
new BMessage(MSG_REMOVE_IMAGE_NAME))) "Stop when an image is loaded",
.End() new BMessage(MSG_STOP_ON_IMAGE_LOAD)))
.End() .Add(fStopImageConstraints = new BMenuField(
"stopTypes", "Types:", stopImageMenu))
.Add(fCustomImageGroup)
.View()); .View());
font_height fontHeight; font_height fontHeight;
@@ -333,8 +338,8 @@ BreakConditionConfigWindow::_Init()
BLayoutBuilder::Group<>(this, B_VERTICAL) BLayoutBuilder::Group<>(this, B_VERTICAL)
.SetInsets(B_USE_DEFAULT_SPACING) .SetInsets(B_USE_DEFAULT_SPACING)
.Add(exceptionSettingsBox) .Add(fExceptionSettingsBox)
.Add(imageSettingsBox) .Add(fImageSettingsBox)
.AddGroup(B_HORIZONTAL) .AddGroup(B_HORIZONTAL)
.AddGlue() .AddGlue()
.Add(fCloseButton = new BButton("Close", new BMessage( .Add(fCloseButton = new BButton("Close", new BMessage(
@@ -343,8 +348,14 @@ BreakConditionConfigWindow::_Init()
fCloseButton->SetTarget(this); fCloseButton->SetTarget(this);
fAddImageNameButton->SetEnabled(false);
fRemoveImageNameButton->SetEnabled(false);
stopImageMenu->SetTargetForItems(this); stopImageMenu->SetTargetForItems(this);
stopImageMenu->SetLabelFromMarked(true); stopImageMenu->SetLabelFromMarked(true);
fStopImageNameInput->SetModificationMessage(
new BMessage(MSG_IMAGE_NAME_INPUT_CHANGED));
fCustomImageGroup->Hide();
AutoLocker< ::Team> teamLocker(fTeam); AutoLocker< ::Team> teamLocker(fTeam);
_UpdateStopImageState(); _UpdateStopImageState();
@@ -418,9 +429,15 @@ BreakConditionConfigWindow::_UpdateExceptionState()
void void
BreakConditionConfigWindow::_UpdateStopImageState() BreakConditionConfigWindow::_UpdateStopImageState()
{ {
bool previousStop = fStopOnLoadEnabled;
bool previousCustomImages = fUseCustomImages && fStopOnLoadEnabled;
fStopOnLoadEnabled = fTeam->StopOnImageLoad();
fStopOnImageLoad->SetValue(
fStopOnLoadEnabled ? B_CONTROL_ON : B_CONTROL_OFF);
fUseCustomImages = fTeam->StopImageNameListEnabled(); fUseCustomImages = fTeam->StopImageNameListEnabled();
fStopImageConstraints->Menu()->ItemAt(0)->SetMarked(!fUseCustomImages); fStopImageConstraints->Menu()
fStopImageConstraints->Menu()->ItemAt(1)->SetMarked(fUseCustomImages); ->ItemAt(fTeam->StopImageNameListEnabled() ? 1 : 0)->SetMarked(true);
fStopImageNames->MakeEmpty(); fStopImageNames->MakeEmpty();
const BStringList& imageNames = fTeam->StopImageNames(); const BStringList& imageNames = fTeam->StopImageNames();
@@ -436,20 +453,18 @@ BreakConditionConfigWindow::_UpdateStopImageState()
itemDeleter.Detach(); itemDeleter.Detach();
} }
_UpdateStopImageButtons(); _UpdateStopImageButtons(previousStop, previousCustomImages);
} }
void void
BreakConditionConfigWindow::_UpdateStopImageButtons() BreakConditionConfigWindow::_UpdateStopImageButtons(bool previousStop,
bool previousCustomImages)
{ {
bool stopOnImageLoad = fTeam->StopOnImageLoad(); fStopImageConstraints->SetEnabled(fStopOnLoadEnabled);
fStopOnImageLoad->SetValue(stopOnImageLoad ? B_CONTROL_ON : B_CONTROL_OFF); bool showCustomGroup = fUseCustomImages && fStopOnLoadEnabled;
bool enabled = stopOnImageLoad && fUseCustomImages; if (!previousCustomImages && showCustomGroup)
fStopImageConstraints->SetEnabled(stopOnImageLoad); fCustomImageGroup->Show();
fAddImageNameButton->SetEnabled(enabled); else if (previousCustomImages && !showCustomGroup)
fRemoveImageNameButton->SetEnabled(enabled fCustomImageGroup->Hide();
&& fStopImageNames->CurrentSelection() >= 0);
fStopImageNames->DoForEach(UpdateItemState, (void*)enabled);
fStopImageNameInput->TextView()->MakeEditable(enabled);
} }
@@ -13,6 +13,7 @@
#include "types/Types.h" #include "types/Types.h"
class BBox;
class BButton; class BButton;
class BCheckBox; class BCheckBox;
class BListView; class BListView;
@@ -56,7 +57,8 @@ private:
void _UpdateExceptionState(); void _UpdateExceptionState();
void _UpdateStopImageState(); void _UpdateStopImageState();
void _UpdateStopImageButtons(); void _UpdateStopImageButtons(bool previousStop,
bool previousCustomImages);
// must be called with team lock held // must be called with team lock held
@@ -64,6 +66,8 @@ private:
private: private:
::Team* fTeam; ::Team* fTeam;
UserInterfaceListener* fListener; UserInterfaceListener* fListener;
BBox* fExceptionSettingsBox;
BBox* fImageSettingsBox;
BCheckBox* fExceptionThrown; BCheckBox* fExceptionThrown;
BCheckBox* fExceptionCaught; BCheckBox* fExceptionCaught;
BCheckBox* fStopOnImageLoad; BCheckBox* fStopOnImageLoad;
@@ -72,6 +76,8 @@ private:
BTextControl* fStopImageNameInput; BTextControl* fStopImageNameInput;
BButton* fAddImageNameButton; BButton* fAddImageNameButton;
BButton* fRemoveImageNameButton; BButton* fRemoveImageNameButton;
BView* fCustomImageGroup;
bool fStopOnLoadEnabled;
bool fUseCustomImages; bool fUseCustomImages;
BButton* fCloseButton; BButton* fCloseButton;
BHandler* fTarget; BHandler* fTarget;
@@ -902,43 +902,42 @@ SourceView::MarkerView::Draw(BRect updateRect)
// get the lines intersecting with the update rect // get the lines intersecting with the update rect
int32 minLine, maxLine; int32 minLine, maxLine;
GetLineRange(updateRect, minLine, maxLine); GetLineRange(updateRect, minLine, maxLine);
if (minLine > maxLine) if (minLine <= maxLine) {
return; // get the markers in that range
SourceView::MarkerManager::MarkerList markers;
fMarkerManager->GetMarkers(minLine, maxLine, markers);
// get the markers in that range float width = Bounds().Width();
SourceView::MarkerManager::MarkerList markers;
fMarkerManager->GetMarkers(minLine, maxLine, markers);
float width = Bounds().Width(); AutoLocker<SourceCode> sourceLocker(fSourceCode);
AutoLocker<SourceCode> sourceLocker(fSourceCode); int32 markerIndex = 0;
for (int32 line = minLine; line <= maxLine; line++) {
bool drawBreakpointOptionMarker = true;
int32 markerIndex = 0; SourceView::MarkerManager::Marker* marker;
for (int32 line = minLine; line <= maxLine; line++) { FillRect(LineRect(line), B_SOLID_LOW);
bool drawBreakpointOptionMarker = true; while ((marker = markers.ItemAt(markerIndex)) != NULL
&& marker->Line() == (uint32)line) {
marker->Draw(this, LineRect(line));
drawBreakpointOptionMarker = false;
markerIndex++;
}
SourceView::MarkerManager::Marker* marker; if (!drawBreakpointOptionMarker)
FillRect(LineRect(line), B_SOLID_LOW); continue;
while ((marker = markers.ItemAt(markerIndex)) != NULL
&& marker->Line() == (uint32)line) { SourceLocation statementStart, statementEnd;
marker->Draw(this, LineRect(line)); if (!fSourceCode->GetStatementLocationRange(SourceLocation(line),
drawBreakpointOptionMarker = false; statementStart, statementEnd)
markerIndex++; || statementStart.Line() != line) {
continue;
}
float y = ((float)line + 0.5f) * fFontInfo->lineHeight;
SetHighColor(fBreakpointOptionMarker);
FillEllipse(BPoint(width - 8, y), 2, 2);
} }
if (!drawBreakpointOptionMarker)
continue;
SourceLocation statementStart, statementEnd;
if (!fSourceCode->GetStatementLocationRange(SourceLocation(line),
statementStart, statementEnd)
|| statementStart.Line() != line) {
continue;
}
float y = ((float)line + 0.5f) * fFontInfo->lineHeight;
SetHighColor(fBreakpointOptionMarker);
FillEllipse(BPoint(width - 8, y), 2, 2);
} }
float y = (maxLine + 1) * fFontInfo->lineHeight; float y = (maxLine + 1) * fFontInfo->lineHeight;
@@ -1154,6 +1153,7 @@ SourceView::TextView::Draw(BRect updateRect)
y = (maxLine + 1) * fFontInfo->lineHeight; y = (maxLine + 1) * fFontInfo->lineHeight;
if (y < updateRect.bottom) { if (y < updateRect.bottom) {
SetLowColor(ui_color(B_DOCUMENT_BACKGROUND_COLOR));
FillRect(BRect(0.0, y, Bounds().right, updateRect.bottom), FillRect(BRect(0.0, y, Bounds().right, updateRect.bottom),
B_SOLID_LOW); B_SOLID_LOW);
} }
+9 -1
View File
@@ -1,5 +1,6 @@
/* /*
* Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@gmx.de. * Copyright 2009-2012, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2013, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
@@ -121,6 +122,11 @@ ValueLoader::LoadValue(ValueLocation* location, type_code valueType,
uint32 bytesToRead = piece.size; uint32 bytesToRead = piece.size;
uint32 bitSize = piece.bitSize; uint32 bitSize = piece.bitSize;
uint8 bitOffset = piece.bitOffset; uint8 bitOffset = piece.bitOffset;
// TODO: the offset's ordinal position and direction aren't
// specified by DWARF, and simply follow the target language.
// To handle non C/C++ languages properly, the corresponding
// SourceLanguage will need to be passed in and extended to
// return the relevant information.
switch (piece.type) { switch (piece.type) {
case VALUE_PIECE_LOCATION_INVALID: case VALUE_PIECE_LOCATION_INVALID:
@@ -178,8 +184,10 @@ ValueLoader::LoadValue(ValueLocation* location, type_code valueType,
if (registerValue.Size() < bytesToRead) if (registerValue.Size() < bytesToRead)
return B_ENTRY_NOT_FOUND; return B_ENTRY_NOT_FOUND;
if (!bigEndian) if (!bigEndian) {
registerValue.SwapEndianess(); registerValue.SwapEndianess();
bitOffset = registerValue.Size() * 8 - bitOffset - bitSize;
}
valueBuffer.AddBits(registerValue.Bytes(), bitSize, bitOffset); valueBuffer.AddBits(registerValue.Bytes(), bitSize, bitOffset);
break; break;
} }
+26 -12
View File
@@ -1156,7 +1156,8 @@ void
TermView::AttachedToWindow() TermView::AttachedToWindow()
{ {
fMouseButtons = 0; fMouseButtons = 0;
fModifiers = modifiers();
_UpdateModifiers();
// update the terminal size because it may have changed while the TermView // update the terminal size because it may have changed while the TermView
// was detached from the window. On such conditions FrameResized was not // was detached from the window. On such conditions FrameResized was not
@@ -1380,14 +1381,9 @@ TermView::WindowActivated(bool active)
_Deactivate(); _Deactivate();
} }
fActiveState->WindowActivated(active); _UpdateModifiers();
if (active) { fActiveState->WindowActivated(active);
int32 oldModifiers = fModifiers;
fModifiers = modifiers();
if (fModifiers != oldModifiers)
fActiveState->ModifiersChanged(oldModifiers, fModifiers);
}
} }
@@ -1409,6 +1405,8 @@ TermView::MakeFocus(bool focusState)
void void
TermView::KeyDown(const char *bytes, int32 numBytes) TermView::KeyDown(const char *bytes, int32 numBytes)
{ {
_UpdateModifiers();
fActiveState->KeyDown(bytes, numBytes); fActiveState->KeyDown(bytes, numBytes);
} }
@@ -1601,10 +1599,7 @@ TermView::MessageReceived(BMessage *msg)
case B_MODIFIERS_CHANGED: case B_MODIFIERS_CHANGED:
{ {
int32 oldModifiers = fModifiers; _UpdateModifiers();
fModifiers = msg->GetInt32("modifiers", 0);
if (fModifiers != oldModifiers)
fActiveState->ModifiersChanged(oldModifiers, fModifiers);
break; break;
} }
@@ -2376,6 +2371,8 @@ TermView::MouseDown(BPoint where)
if (!IsFocus()) if (!IsFocus())
MakeFocus(); MakeFocus();
_UpdateModifiers();
BMessage* currentMessage = Window()->CurrentMessage(); BMessage* currentMessage = Window()->CurrentMessage();
int32 buttons = currentMessage->GetInt32("buttons", 0); int32 buttons = currentMessage->GetInt32("buttons", 0);
@@ -2389,6 +2386,8 @@ TermView::MouseDown(BPoint where)
void void
TermView::MouseMoved(BPoint where, uint32 transit, const BMessage *message) TermView::MouseMoved(BPoint where, uint32 transit, const BMessage *message)
{ {
_UpdateModifiers();
fActiveState->MouseMoved(where, transit, message, fModifiers); fActiveState->MouseMoved(where, transit, message, fModifiers);
} }
@@ -2396,6 +2395,8 @@ TermView::MouseMoved(BPoint where, uint32 transit, const BMessage *message)
void void
TermView::MouseUp(BPoint where) TermView::MouseUp(BPoint where)
{ {
_UpdateModifiers();
int32 buttons = Window()->CurrentMessage()->GetInt32("buttons", 0); int32 buttons = Window()->CurrentMessage()->GetInt32("buttons", 0);
fActiveState->MouseUp(where, buttons); fActiveState->MouseUp(where, buttons);
@@ -2975,6 +2976,19 @@ TermView::_CancelInputMethod()
} }
void
TermView::_UpdateModifiers()
{
// TODO: This method is a general work-around for missing or out-of-order
// B_MODIFIERS_CHANGED messages. This should really be fixed where it is
// broken (app server?).
int32 oldModifiers = fModifiers;
fModifiers = modifiers();
if (fModifiers != oldModifiers && fActiveState != NULL)
fActiveState->ModifiersChanged(oldModifiers, fModifiers);
}
void void
TermView::_NextState(State* state) TermView::_NextState(State* state)
{ {
+2
View File
@@ -251,6 +251,8 @@ private:
void _HandleInputMethodLocationRequest(); void _HandleInputMethodLocationRequest();
void _CancelInputMethod(); void _CancelInputMethod();
void _UpdateModifiers();
void _NextState(State* state); void _NextState(State* state);
private: private:
+7 -7
View File
@@ -686,13 +686,13 @@ dump_cpus(system_info *info)
static void static void
dump_mem(system_info *info) dump_mem(system_info *info)
{ {
printf("%10" B_PRIu32 " bytes free (used/max %10" B_PRIu32 " / %10" printf("%10" B_PRIu64 " bytes free (used/max %10" B_PRIu64 " / %10"
B_PRIu32 ")\n", B_PRIu64 ")\n",
B_PAGE_SIZE * (uint32)(info->max_pages - info->used_pages), B_PAGE_SIZE * (uint64)(info->max_pages - info->used_pages),
B_PAGE_SIZE * (uint32)info->used_pages, B_PAGE_SIZE * (uint64)info->used_pages,
B_PAGE_SIZE * (uint32)info->max_pages); B_PAGE_SIZE * (uint64)info->max_pages);
printf(" (cached %10" B_PRIu32 ")\n", printf(" (cached %10" B_PRIu64 ")\n",
B_PAGE_SIZE * (uint32)info->cached_pages); B_PAGE_SIZE * (uint64)info->cached_pages);
} }
+3 -3
View File
@@ -83,7 +83,7 @@ BChannelSlider::BChannelSlider(BRect area, const char* name, const char* label,
BChannelSlider::BChannelSlider(BRect area, const char* name, const char* label, BChannelSlider::BChannelSlider(BRect area, const char* name, const char* label,
BMessage* model, enum orientation orientation, int32 channels, BMessage* model, orientation orientation, int32 channels,
uint32 resizeMode, uint32 flags) uint32 resizeMode, uint32 flags)
: BChannelControl(area, name, label, model, channels, resizeMode, flags) : BChannelControl(area, name, label, model, channels, resizeMode, flags)
@@ -94,7 +94,7 @@ BChannelSlider::BChannelSlider(BRect area, const char* name, const char* label,
BChannelSlider::BChannelSlider(const char* name, const char* label, BChannelSlider::BChannelSlider(const char* name, const char* label,
BMessage* model, enum orientation orientation, int32 channels, BMessage* model, orientation orientation, int32 channels,
uint32 flags) uint32 flags)
: BChannelControl(name, label, model, channels, flags) : BChannelControl(name, label, model, channels, flags)
@@ -502,7 +502,7 @@ BChannelSlider::Orientation() const
void void
BChannelSlider::SetOrientation(enum orientation orientation) BChannelSlider::SetOrientation(orientation orientation)
{ {
bool isVertical = orientation == B_VERTICAL; bool isVertical = orientation == B_VERTICAL;
if (isVertical != fIsVertical) { if (isVertical != fIsVertical) {
+19 -19
View File
@@ -143,7 +143,7 @@ BControlLook::DrawButtonFrame(BView* view, BRect& rect,
void void
BControlLook::DrawButtonBackground(BView* view, BRect& rect, BControlLook::DrawButtonBackground(BView* view, BRect& rect,
const BRect& updateRect, const rgb_color& base, uint32 flags, const BRect& updateRect, const rgb_color& base, uint32 flags,
uint32 borders, enum orientation orientation) uint32 borders, orientation orientation)
{ {
_DrawButtonBackground(view, rect, updateRect, 0.0f, 0.0f, 0.0f, 0.0f, _DrawButtonBackground(view, rect, updateRect, 0.0f, 0.0f, 0.0f, 0.0f,
base, flags, borders, orientation); base, flags, borders, orientation);
@@ -153,7 +153,7 @@ BControlLook::DrawButtonBackground(BView* view, BRect& rect,
void void
BControlLook::DrawButtonBackground(BView* view, BRect& rect, BControlLook::DrawButtonBackground(BView* view, BRect& rect,
const BRect& updateRect, float radius, const rgb_color& base, uint32 flags, const BRect& updateRect, float radius, const rgb_color& base, uint32 flags,
uint32 borders, enum orientation orientation) uint32 borders, orientation orientation)
{ {
_DrawButtonBackground(view, rect, updateRect, radius, radius, radius, _DrawButtonBackground(view, rect, updateRect, radius, radius, radius,
radius, base, flags, borders, orientation); radius, base, flags, borders, orientation);
@@ -164,7 +164,7 @@ void
BControlLook::DrawButtonBackground(BView* view, BRect& rect, BControlLook::DrawButtonBackground(BView* view, BRect& rect,
const BRect& updateRect, float leftTopRadius, float rightTopRadius, const BRect& updateRect, float leftTopRadius, float rightTopRadius,
float leftBottomRadius, float rightBottomRadius, const rgb_color& base, float leftBottomRadius, float rightBottomRadius, const rgb_color& base,
uint32 flags, uint32 borders, enum orientation orientation) uint32 flags, uint32 borders, orientation orientation)
{ {
_DrawButtonBackground(view, rect, updateRect, leftTopRadius, _DrawButtonBackground(view, rect, updateRect, leftTopRadius,
rightTopRadius, leftBottomRadius, rightBottomRadius, base, flags, rightTopRadius, leftBottomRadius, rightBottomRadius, base, flags,
@@ -553,7 +553,7 @@ BControlLook::DrawRadioButton(BView* view, BRect& rect, const BRect& updateRect,
void void
BControlLook::DrawScrollBarBackground(BView* view, BRect& rect1, BRect& rect2, BControlLook::DrawScrollBarBackground(BView* view, BRect& rect1, BRect& rect2,
const BRect& updateRect, const rgb_color& base, uint32 flags, const BRect& updateRect, const rgb_color& base, uint32 flags,
enum orientation orientation) orientation orientation)
{ {
DrawScrollBarBackground(view, rect1, updateRect, base, flags, orientation); DrawScrollBarBackground(view, rect1, updateRect, base, flags, orientation);
DrawScrollBarBackground(view, rect2, updateRect, base, flags, orientation); DrawScrollBarBackground(view, rect2, updateRect, base, flags, orientation);
@@ -563,7 +563,7 @@ BControlLook::DrawScrollBarBackground(BView* view, BRect& rect1, BRect& rect2,
void void
BControlLook::DrawScrollBarBackground(BView* view, BRect& rect, BControlLook::DrawScrollBarBackground(BView* view, BRect& rect,
const BRect& updateRect, const rgb_color& base, uint32 flags, const BRect& updateRect, const rgb_color& base, uint32 flags,
enum orientation orientation) orientation orientation)
{ {
if (!rect.IsValid() || !rect.Intersects(updateRect)) if (!rect.IsValid() || !rect.Intersects(updateRect))
return; return;
@@ -818,7 +818,7 @@ BControlLook::SliderBarColor(const rgb_color& base)
void void
BControlLook::DrawSliderBar(BView* view, BRect rect, const BRect& updateRect, BControlLook::DrawSliderBar(BView* view, BRect rect, const BRect& updateRect,
const rgb_color& base, rgb_color leftFillColor, rgb_color rightFillColor, const rgb_color& base, rgb_color leftFillColor, rgb_color rightFillColor,
float sliderScale, uint32 flags, enum orientation orientation) float sliderScale, uint32 flags, orientation orientation)
{ {
if (!rect.IsValid() || !rect.Intersects(updateRect)) if (!rect.IsValid() || !rect.Intersects(updateRect))
return; return;
@@ -875,7 +875,7 @@ BControlLook::DrawSliderBar(BView* view, BRect rect, const BRect& updateRect,
void void
BControlLook::DrawSliderBar(BView* view, BRect rect, const BRect& updateRect, BControlLook::DrawSliderBar(BView* view, BRect rect, const BRect& updateRect,
const rgb_color& base, rgb_color fillColor, uint32 flags, const rgb_color& base, rgb_color fillColor, uint32 flags,
enum orientation orientation) orientation orientation)
{ {
if (!rect.IsValid() || !rect.Intersects(updateRect)) if (!rect.IsValid() || !rect.Intersects(updateRect))
return; return;
@@ -1021,7 +1021,7 @@ BControlLook::DrawSliderBar(BView* view, BRect rect, const BRect& updateRect,
void void
BControlLook::DrawSliderThumb(BView* view, BRect& rect, const BRect& updateRect, BControlLook::DrawSliderThumb(BView* view, BRect& rect, const BRect& updateRect,
const rgb_color& base, uint32 flags, enum orientation orientation) const rgb_color& base, uint32 flags, orientation orientation)
{ {
if (!rect.IsValid() || !rect.Intersects(updateRect)) if (!rect.IsValid() || !rect.Intersects(updateRect))
return; return;
@@ -1106,7 +1106,7 @@ BControlLook::DrawSliderThumb(BView* view, BRect& rect, const BRect& updateRect,
void void
BControlLook::DrawSliderTriangle(BView* view, BRect& rect, BControlLook::DrawSliderTriangle(BView* view, BRect& rect,
const BRect& updateRect, const rgb_color& base, uint32 flags, const BRect& updateRect, const rgb_color& base, uint32 flags,
enum orientation orientation) orientation orientation)
{ {
DrawSliderTriangle(view, rect, updateRect, base, base, flags, orientation); DrawSliderTriangle(view, rect, updateRect, base, base, flags, orientation);
} }
@@ -1115,7 +1115,7 @@ BControlLook::DrawSliderTriangle(BView* view, BRect& rect,
void void
BControlLook::DrawSliderTriangle(BView* view, BRect& rect, BControlLook::DrawSliderTriangle(BView* view, BRect& rect,
const BRect& updateRect, const rgb_color& base, const rgb_color& fill, const BRect& updateRect, const rgb_color& base, const rgb_color& fill,
uint32 flags, enum orientation orientation) uint32 flags, orientation orientation)
{ {
if (!rect.IsValid() || !rect.Intersects(updateRect)) if (!rect.IsValid() || !rect.Intersects(updateRect))
return; return;
@@ -1234,7 +1234,7 @@ BControlLook::DrawSliderTriangle(BView* view, BRect& rect,
void void
BControlLook::DrawSliderHashMarks(BView* view, BRect& rect, BControlLook::DrawSliderHashMarks(BView* view, BRect& rect,
const BRect& updateRect, const rgb_color& base, int32 count, const BRect& updateRect, const rgb_color& base, int32 count,
hash_mark_location location, uint32 flags, enum orientation orientation) hash_mark_location location, uint32 flags, orientation orientation)
{ {
if (!rect.IsValid() || !rect.Intersects(updateRect)) if (!rect.IsValid() || !rect.Intersects(updateRect))
return; return;
@@ -1482,7 +1482,7 @@ BControlLook::DrawInactiveTab(BView* view, BRect& rect, const BRect& updateRect,
void void
BControlLook::DrawSplitter(BView* view, BRect& rect, const BRect& updateRect, BControlLook::DrawSplitter(BView* view, BRect& rect, const BRect& updateRect,
const rgb_color& base, enum orientation orientation, uint32 flags, const rgb_color& base, orientation orientation, uint32 flags,
uint32 borders) uint32 borders)
{ {
if (!rect.IsValid() || !rect.Intersects(updateRect)) if (!rect.IsValid() || !rect.Intersects(updateRect))
@@ -2180,7 +2180,7 @@ void
BControlLook::_DrawButtonBackground(BView* view, BRect& rect, BControlLook::_DrawButtonBackground(BView* view, BRect& rect,
const BRect& updateRect, float leftTopRadius, float rightTopRadius, const BRect& updateRect, float leftTopRadius, float rightTopRadius,
float leftBottomRadius, float rightBottomRadius, const rgb_color& base, float leftBottomRadius, float rightBottomRadius, const rgb_color& base,
uint32 flags, uint32 borders, enum orientation orientation) uint32 flags, uint32 borders, orientation orientation)
{ {
if (!rect.IsValid() || !rect.Intersects(updateRect)) if (!rect.IsValid() || !rect.Intersects(updateRect))
return; return;
@@ -2886,7 +2886,7 @@ BControlLook::_DrawRoundBarCorner(BView* view, BRect& rect,
const rgb_color& frameLightColor, const rgb_color& frameShadowColor, const rgb_color& frameLightColor, const rgb_color& frameShadowColor,
const rgb_color& fillLightColor, const rgb_color& fillShadowColor, const rgb_color& fillLightColor, const rgb_color& fillShadowColor,
float leftInset, float topInset, float rightInset, float bottomInset, float leftInset, float topInset, float rightInset, float bottomInset,
enum orientation orientation) orientation orientation)
{ {
if (!rect.IsValid() || !rect.Intersects(updateRect)) if (!rect.IsValid() || !rect.Intersects(updateRect))
return; return;
@@ -3102,7 +3102,7 @@ BControlLook::_BevelShadowColor(const rgb_color& base, uint32 flags)
void void
BControlLook::_FillGradient(BView* view, const BRect& rect, BControlLook::_FillGradient(BView* view, const BRect& rect,
const rgb_color& base, float topTint, float bottomTint, const rgb_color& base, float topTint, float bottomTint,
enum orientation orientation) orientation orientation)
{ {
BGradientLinear gradient; BGradientLinear gradient;
_MakeGradient(gradient, rect, base, topTint, bottomTint, orientation); _MakeGradient(gradient, rect, base, topTint, bottomTint, orientation);
@@ -3113,7 +3113,7 @@ BControlLook::_FillGradient(BView* view, const BRect& rect,
void void
BControlLook::_FillGlossyGradient(BView* view, const BRect& rect, BControlLook::_FillGlossyGradient(BView* view, const BRect& rect,
const rgb_color& base, float topTint, float middle1Tint, const rgb_color& base, float topTint, float middle1Tint,
float middle2Tint, float bottomTint, enum orientation orientation) float middle2Tint, float bottomTint, orientation orientation)
{ {
BGradientLinear gradient; BGradientLinear gradient;
_MakeGlossyGradient(gradient, rect, base, topTint, middle1Tint, _MakeGlossyGradient(gradient, rect, base, topTint, middle1Tint,
@@ -3125,7 +3125,7 @@ BControlLook::_FillGlossyGradient(BView* view, const BRect& rect,
void void
BControlLook::_MakeGradient(BGradientLinear& gradient, const BRect& rect, BControlLook::_MakeGradient(BGradientLinear& gradient, const BRect& rect,
const rgb_color& base, float topTint, float bottomTint, const rgb_color& base, float topTint, float bottomTint,
enum orientation orientation) const orientation orientation) const
{ {
gradient.AddColor(tint_color(base, topTint), 0); gradient.AddColor(tint_color(base, topTint), 0);
gradient.AddColor(tint_color(base, bottomTint), 255); gradient.AddColor(tint_color(base, bottomTint), 255);
@@ -3141,7 +3141,7 @@ void
BControlLook::_MakeGlossyGradient(BGradientLinear& gradient, const BRect& rect, BControlLook::_MakeGlossyGradient(BGradientLinear& gradient, const BRect& rect,
const rgb_color& base, float topTint, float middle1Tint, const rgb_color& base, float topTint, float middle1Tint,
float middle2Tint, float bottomTint, float middle2Tint, float bottomTint,
enum orientation orientation) const orientation orientation) const
{ {
gradient.AddColor(tint_color(base, topTint), 0); gradient.AddColor(tint_color(base, topTint), 0);
gradient.AddColor(tint_color(base, middle1Tint), 132); gradient.AddColor(tint_color(base, middle1Tint), 132);
@@ -3157,7 +3157,7 @@ BControlLook::_MakeGlossyGradient(BGradientLinear& gradient, const BRect& rect,
void void
BControlLook::_MakeButtonGradient(BGradientLinear& gradient, BRect& rect, BControlLook::_MakeButtonGradient(BGradientLinear& gradient, BRect& rect,
const rgb_color& base, uint32 flags, enum orientation orientation) const const rgb_color& base, uint32 flags, orientation orientation) const
{ {
float topTint = 0.49; float topTint = 0.49;
float middleTint1 = 0.62; float middleTint1 = 0.62;
+1 -1
View File
@@ -665,7 +665,7 @@ BGridLayout::InternalCountRows()
void void
BGridLayout::GetColumnRowConstraints(enum orientation orientation, int32 index, BGridLayout::GetColumnRowConstraints(orientation orientation, int32 index,
ColumnRowConstraints* constraints) ColumnRowConstraints* constraints)
{ {
if (orientation == B_HORIZONTAL) { if (orientation == B_HORIZONTAL) {
+4 -4
View File
@@ -33,7 +33,7 @@ struct BGroupLayout::ItemLayoutData {
}; };
BGroupLayout::BGroupLayout(enum orientation orientation, float spacing) BGroupLayout::BGroupLayout(orientation orientation, float spacing)
: :
BTwoDimensionalLayout(), BTwoDimensionalLayout(),
fOrientation(orientation) fOrientation(orientation)
@@ -85,7 +85,7 @@ BGroupLayout::Orientation() const
void void
BGroupLayout::SetOrientation(enum orientation orientation) BGroupLayout::SetOrientation(orientation orientation)
{ {
if (orientation != fOrientation) { if (orientation != fOrientation) {
fOrientation = orientation; fOrientation = orientation;
@@ -262,7 +262,7 @@ BGroupLayout::ItemRemoved(BLayoutItem* item, int32 fromIndex)
void void
BGroupLayout::PrepareItems(enum orientation orientation) BGroupLayout::PrepareItems(orientation orientation)
{ {
// filter the visible items // filter the visible items
fVisibleItems.MakeEmpty(); fVisibleItems.MakeEmpty();
@@ -290,7 +290,7 @@ BGroupLayout::InternalCountRows()
void void
BGroupLayout::GetColumnRowConstraints(enum orientation orientation, int32 index, BGroupLayout::GetColumnRowConstraints(orientation orientation, int32 index,
ColumnRowConstraints* constraints) ColumnRowConstraints* constraints)
{ {
if (index >= 0 && index < fVisibleItems.CountItems()) { if (index >= 0 && index < fVisibleItems.CountItems()) {
+3 -3
View File
@@ -14,7 +14,7 @@ using std::nothrow;
// constructor // constructor
BGroupLayoutBuilder::BGroupLayoutBuilder(enum orientation orientation, BGroupLayoutBuilder::BGroupLayoutBuilder(orientation orientation,
float spacing) float spacing)
: fRootLayout((new BGroupView(orientation, spacing))->GroupLayout()) : fRootLayout((new BGroupView(orientation, spacing))->GroupLayout())
{ {
@@ -118,8 +118,8 @@ BGroupLayoutBuilder::Add(BLayoutItem* item, float weight)
// AddGroup // AddGroup
BGroupLayoutBuilder& BGroupLayoutBuilder&
BGroupLayoutBuilder::AddGroup(enum orientation orientation, BGroupLayoutBuilder::AddGroup(orientation orientation, float spacing,
float spacing, float weight) float weight)
{ {
if (BGroupLayout* layout = TopLayout()) { if (BGroupLayout* layout = TopLayout()) {
BGroupView* group = new(nothrow) BGroupView(orientation, spacing); BGroupView* group = new(nothrow) BGroupView(orientation, spacing);
+3 -3
View File
@@ -8,7 +8,7 @@
#include <GroupView.h> #include <GroupView.h>
BGroupView::BGroupView(enum orientation orientation, float spacing) BGroupView::BGroupView(orientation orientation, float spacing)
: :
BView(NULL, 0, new BGroupLayout(orientation, spacing)) BView(NULL, 0, new BGroupLayout(orientation, spacing))
{ {
@@ -16,8 +16,8 @@ BGroupView::BGroupView(enum orientation orientation, float spacing)
} }
BGroupView::BGroupView(const char* name, enum orientation orientation, BGroupView::BGroupView(const char* name, orientation orientation,
float spacing) float spacing)
: :
BView(name, 0, new BGroupLayout(orientation, spacing)) BView(name, 0, new BGroupLayout(orientation, spacing))
{ {
+1 -1
View File
@@ -595,7 +595,7 @@ BScrollBar::Target() const
void void
BScrollBar::SetOrientation(enum orientation orientation) BScrollBar::SetOrientation(orientation orientation)
{ {
if (fOrientation == orientation) if (fOrientation == orientation)
return; return;
+7 -8
View File
@@ -24,8 +24,7 @@ static const float kMinBorderLength = 5.0f;
// TODO: More testing, especially archiving. // TODO: More testing, especially archiving.
BSeparatorView::BSeparatorView(enum orientation orientation, BSeparatorView::BSeparatorView(orientation orientation, border_style border)
border_style border)
: :
BView(NULL, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE) BView(NULL, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE)
{ {
@@ -35,7 +34,7 @@ BSeparatorView::BSeparatorView(enum orientation orientation,
BSeparatorView::BSeparatorView(const char* name, const char* label, BSeparatorView::BSeparatorView(const char* name, const char* label,
enum orientation orientation, border_style border, orientation orientation, border_style border,
const BAlignment& alignment) const BAlignment& alignment)
: :
BView(name, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE) BView(name, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE)
@@ -45,7 +44,7 @@ BSeparatorView::BSeparatorView(const char* name, const char* label,
BSeparatorView::BSeparatorView(const char* name, BView* labelView, BSeparatorView::BSeparatorView(const char* name, BView* labelView,
enum orientation orientation, border_style border, orientation orientation, border_style border,
const BAlignment& alignment) const BAlignment& alignment)
: :
BView(name, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE) BView(name, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE)
@@ -55,7 +54,7 @@ BSeparatorView::BSeparatorView(const char* name, BView* labelView,
BSeparatorView::BSeparatorView(const char* label, BSeparatorView::BSeparatorView(const char* label,
enum orientation orientation, border_style border, orientation orientation, border_style border,
const BAlignment& alignment) const BAlignment& alignment)
: :
BView("", B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE) BView("", B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE)
@@ -65,7 +64,7 @@ BSeparatorView::BSeparatorView(const char* label,
BSeparatorView::BSeparatorView(BView* labelView, BSeparatorView::BSeparatorView(BView* labelView,
enum orientation orientation, border_style border, orientation orientation, border_style border,
const BAlignment& alignment) const BAlignment& alignment)
: :
BView("", B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE) BView("", B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE)
@@ -331,7 +330,7 @@ BSeparatorView::PreferredSize()
void void
BSeparatorView::SetOrientation(enum orientation orientation) BSeparatorView::SetOrientation(orientation orientation)
{ {
if (orientation == fOrientation) if (orientation == fOrientation)
return; return;
@@ -437,7 +436,7 @@ BSeparatorView::DoLayout()
void void
BSeparatorView::_Init(const char* label, BView* labelView, BSeparatorView::_Init(const char* label, BView* labelView,
enum orientation orientation, BAlignment alignment, border_style border) orientation orientation, BAlignment alignment, border_style border)
{ {
fLabel = ""; fLabel = "";
fLabelView = NULL; fLabelView = NULL;
+2 -3
View File
@@ -153,8 +153,7 @@ private:
// #pragma mark - // #pragma mark -
BSplitLayout::BSplitLayout(enum orientation orientation, BSplitLayout::BSplitLayout(orientation orientation, float spacing)
float spacing)
: :
fOrientation(orientation), fOrientation(orientation),
fLeftInset(0), fLeftInset(0),
@@ -319,7 +318,7 @@ BSplitLayout::Orientation() const
void void
BSplitLayout::SetOrientation(enum orientation orientation) BSplitLayout::SetOrientation(orientation orientation)
{ {
if (orientation != fOrientation) { if (orientation != fOrientation) {
fOrientation = orientation; fOrientation = orientation;
+2 -2
View File
@@ -23,7 +23,7 @@ using BPrivate::Layout::LayoutInfo;
class BSplitLayout : public BAbstractLayout { class BSplitLayout : public BAbstractLayout {
public: public:
BSplitLayout(enum orientation orientation, BSplitLayout(orientation orientation,
float spacing = 0.0f); float spacing = 0.0f);
BSplitLayout(BMessage* from); BSplitLayout(BMessage* from);
virtual ~BSplitLayout(); virtual ~BSplitLayout();
@@ -37,7 +37,7 @@ public:
void SetSpacing(float spacing); void SetSpacing(float spacing);
orientation Orientation() const; orientation Orientation() const;
void SetOrientation(enum orientation orientation); void SetOrientation(orientation orientation);
float SplitterSize() const; float SplitterSize() const;
void SetSplitterSize(float size); void SetSplitterSize(float size);
+1 -1
View File
@@ -12,7 +12,7 @@ using std::nothrow;
// constructor // constructor
BSplitLayoutBuilder::BSplitLayoutBuilder(enum orientation orientation, BSplitLayoutBuilder::BSplitLayoutBuilder(orientation orientation,
float spacing) float spacing)
: fView(new BSplitView(orientation, spacing)) : fView(new BSplitView(orientation, spacing))
{ {
+4 -4
View File
@@ -14,7 +14,7 @@
#include "SplitLayout.h" #include "SplitLayout.h"
BSplitView::BSplitView(enum orientation orientation, float spacing) BSplitView::BSplitView(orientation orientation, float spacing)
: :
BView(NULL, BView(NULL,
B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_INVALIDATE_AFTER_LAYOUT, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_INVALIDATE_AFTER_LAYOUT,
@@ -97,7 +97,7 @@ BSplitView::Orientation() const
void void
BSplitView::SetOrientation(enum orientation orientation) BSplitView::SetOrientation(orientation orientation)
{ {
fSplitLayout->SetOrientation(orientation); fSplitLayout->SetOrientation(orientation);
} }
@@ -358,7 +358,7 @@ BSplitView::Instantiate(BMessage* from)
void void
BSplitView::DrawSplitter(BRect frame, const BRect& updateRect, BSplitView::DrawSplitter(BRect frame, const BRect& updateRect,
enum orientation orientation, bool pressed) orientation orientation, bool pressed)
{ {
_DrawDefaultSplitter(this, frame, updateRect, orientation, pressed); _DrawDefaultSplitter(this, frame, updateRect, orientation, pressed);
} }
@@ -366,7 +366,7 @@ BSplitView::DrawSplitter(BRect frame, const BRect& updateRect,
void void
BSplitView::_DrawDefaultSplitter(BView* view, BRect frame, BSplitView::_DrawDefaultSplitter(BView* view, BRect frame,
const BRect& updateRect, enum orientation orientation, bool pressed) const BRect& updateRect, orientation orientation, bool pressed)
{ {
uint32 flags = pressed ? BControlLook::B_ACTIVATED : 0; uint32 flags = pressed ? BControlLook::B_ACTIVATED : 0;
be_control_look->DrawSplitter(view, frame, updateRect, view->ViewColor(), be_control_look->DrawSplitter(view, frame, updateRect, view->ViewColor(),
+8 -8
View File
@@ -56,7 +56,7 @@
// CompoundLayouter // CompoundLayouter
class BTwoDimensionalLayout::CompoundLayouter : public BReferenceable { class BTwoDimensionalLayout::CompoundLayouter : public BReferenceable {
public: public:
CompoundLayouter(enum orientation orientation); CompoundLayouter(orientation orientation);
virtual ~CompoundLayouter(); virtual ~CompoundLayouter();
orientation Orientation(); orientation Orientation();
@@ -167,7 +167,7 @@ public:
float* preferredHeight); float* preferredHeight);
void AlignWith(LocalLayouter* other, void AlignWith(LocalLayouter* other,
enum orientation orientation); orientation orientation);
// Archiving stuff // Archiving stuff
status_t AddAlignedLayoutsToArchive(BArchiver* archiver); status_t AddAlignedLayoutsToArchive(BArchiver* archiver);
@@ -203,7 +203,7 @@ public:
void SetCompoundLayouter( void SetCompoundLayouter(
CompoundLayouter* compoundLayouter, CompoundLayouter* compoundLayouter,
enum orientation orientation); orientation orientation);
void InternalInvalidateLayout( void InternalInvalidateLayout(
CompoundLayouter* compoundLayouter); CompoundLayouter* compoundLayouter);
@@ -336,7 +336,7 @@ BTwoDimensionalLayout::GetInsets(float* left, float* top, float* right,
void void
BTwoDimensionalLayout::AlignLayoutWith(BTwoDimensionalLayout* other, BTwoDimensionalLayout::AlignLayoutWith(BTwoDimensionalLayout* other,
enum orientation orientation) orientation orientation)
{ {
if (!other || other == this) if (!other || other == this)
return; return;
@@ -573,7 +573,7 @@ BTwoDimensionalLayout::SubtractInsets(BSize size)
void void
BTwoDimensionalLayout::PrepareItems(enum orientation orientation) BTwoDimensionalLayout::PrepareItems(orientation orientation)
{ {
} }
@@ -603,7 +603,7 @@ BTwoDimensionalLayout::_ValidateMinMax()
BTwoDimensionalLayout::CompoundLayouter::CompoundLayouter( BTwoDimensionalLayout::CompoundLayouter::CompoundLayouter(
enum orientation orientation) orientation orientation)
: :
fLayouter(NULL), fLayouter(NULL),
fLayoutInfo(NULL), fLayoutInfo(NULL),
@@ -1154,7 +1154,7 @@ BTwoDimensionalLayout::LocalLayouter::InternalGetHeightForWidth(float width,
void void
BTwoDimensionalLayout::LocalLayouter::AlignWith(LocalLayouter* other, BTwoDimensionalLayout::LocalLayouter::AlignWith(LocalLayouter* other,
enum orientation orientation) orientation orientation)
{ {
if (orientation == B_HORIZONTAL) if (orientation == B_HORIZONTAL)
other->fHLayouter->AbsorbCompoundLayouter(fHLayouter); other->fHLayouter->AbsorbCompoundLayouter(fHLayouter);
@@ -1365,7 +1365,7 @@ BTwoDimensionalLayout::LocalLayouter::SetHeightForWidthConstraintsAdded(
void void
BTwoDimensionalLayout::LocalLayouter::SetCompoundLayouter( BTwoDimensionalLayout::LocalLayouter::SetCompoundLayouter(
CompoundLayouter* compoundLayouter, enum orientation orientation) CompoundLayouter* compoundLayouter, orientation orientation)
{ {
CompoundLayouter* oldCompoundLayouter; CompoundLayouter* oldCompoundLayouter;
if (orientation == B_HORIZONTAL) { if (orientation == B_HORIZONTAL) {
+13 -4
View File
@@ -127,8 +127,8 @@ private:
uint32 fMagic3; uint32 fMagic3;
}; };
static TracingMetaData sDummyTracingMetaData; static TracingMetaData sFallbackTracingMetaData;
static TracingMetaData* sTracingMetaData = &sDummyTracingMetaData; static TracingMetaData* sTracingMetaData = &sFallbackTracingMetaData;
static bool sTracingDataRecovered = false; static bool sTracingDataRecovered = false;
@@ -525,7 +525,15 @@ TracingMetaData::_CreateMetaDataArea(bool findPrevious, area_id& _area,
delete_area(area); delete_area(area);
} }
return B_ENTRY_NOT_FOUND; if (findPrevious)
return B_ENTRY_NOT_FOUND;
// We could allocate any of the standard locations. Instead of failing
// entirely, we use the static meta data. The tracing buffer won't be
// reattachable in the next session, but at least we can use it in this
// session.
_metaData = &sFallbackTracingMetaData;
return B_OK;
} }
@@ -1786,7 +1794,8 @@ tracing_init(void)
#if ENABLE_TRACING #if ENABLE_TRACING
status_t result = TracingMetaData::Create(sTracingMetaData); status_t result = TracingMetaData::Create(sTracingMetaData);
if (result != B_OK) { if (result != B_OK) {
sTracingMetaData = &sDummyTracingMetaData; memset(&sFallbackTracingMetaData, 0, sizeof(sFallbackTracingMetaData));
sTracingMetaData = &sFallbackTracingMetaData;
return result; return result;
} }
+1 -1
View File
@@ -457,7 +457,7 @@ reserve_io_interrupt_vectors(long count, long startVector)
} }
/*! Allocate \a count contigous interrupt vectors. The vectors are allocated /*! Allocate \a count contiguous interrupt vectors. The vectors are allocated
as available so that they do not overlap with any other reserved vector. as available so that they do not overlap with any other reserved vector.
The first vector to be used is returned in \a startVector on success. The first vector to be used is returned in \a startVector on success.
*/ */
@@ -511,7 +511,7 @@ MultiAddressSpaceLocker::AddAreaCacheAndLock(area_id areaID,
VMArea* firstArea = cache->areas; VMArea* firstArea = cache->areas;
for (VMArea* current = firstArea; current; for (VMArea* current = firstArea; current;
current = current->cache_next) { current = current->cache_next) {
error = AddArea(current->id, error = AddArea(current,
current == area ? writeLockThisOne : writeLockOthers); current == area ? writeLockThisOne : writeLockOthers);
if (error != B_OK) { if (error != B_OK) {
vm_area_put_locked_cache(cache); vm_area_put_locked_cache(cache);
@@ -569,5 +569,3 @@ MultiAddressSpaceLocker::AddAreaCacheAndLock(area_id areaID,
memcpy(fItems, originalItems, fCount * sizeof(lock_item)); memcpy(fItems, originalItems, fCount * sizeof(lock_item));
} }
} }
@@ -91,6 +91,8 @@ public:
VMAddressSpace** _space = NULL); VMAddressSpace** _space = NULL);
inline status_t AddArea(area_id area, bool writeLock, inline status_t AddArea(area_id area, bool writeLock,
VMAddressSpace** _space = NULL); VMAddressSpace** _space = NULL);
inline status_t AddArea(VMArea* area, bool writeLock,
VMAddressSpace** _space = NULL);
status_t AddAreaCacheAndLock(area_id areaID, status_t AddAreaCacheAndLock(area_id areaID,
bool writeLockThisOne, bool writeLockOthers, bool writeLockThisOne, bool writeLockOthers,
@@ -139,4 +141,13 @@ MultiAddressSpaceLocker::AddArea(area_id area, bool writeLock,
} }
inline status_t
MultiAddressSpaceLocker::AddArea(VMArea* area, bool writeLock,
VMAddressSpace** _space)
{
area->address_space->Get();
return _AddAddressSpace(area->address_space, writeLock, _space);
}
#endif // VM_ADDRESS_SPACE_LOCKING_H #endif // VM_ADDRESS_SPACE_LOCKING_H
+1 -1
View File
@@ -3887,7 +3887,7 @@ vm_page_allocate_page_run(uint32 flags, page_num_t length,
dprintf("vm_page_allocate_page_run(): Failed to allocate run of " dprintf("vm_page_allocate_page_run(): Failed to allocate run of "
"length %" B_PRIuPHYSADDR " (%" B_PRIuPHYSADDR " %" "length %" B_PRIuPHYSADDR " (%" B_PRIuPHYSADDR " %"
B_PRIuPHYSADDR ") in second iteration (align: %" B_PRIuPHYSADDR B_PRIuPHYSADDR ") in second iteration (align: %" B_PRIuPHYSADDR
" boundary: %" B_PRIuPHYSADDR ") !", length, requestedStart, " boundary: %" B_PRIuPHYSADDR ")!\n", length, requestedStart,
end, restrictions->alignment, restrictions->boundary); end, restrictions->alignment, restrictions->boundary);
freeClearQueueLocker.Unlock(); freeClearQueueLocker.Unlock();