MenuPrivate: Style fixes to MenuPrivate.h
This commit is contained in:
@@ -9,8 +9,10 @@
|
|||||||
#ifndef __MENU_PRIVATE_H
|
#ifndef __MENU_PRIVATE_H
|
||||||
#define __MENU_PRIVATE_H
|
#define __MENU_PRIVATE_H
|
||||||
|
|
||||||
|
|
||||||
#include <Menu.h>
|
#include <Menu.h>
|
||||||
|
|
||||||
|
|
||||||
enum menu_states {
|
enum menu_states {
|
||||||
MENU_STATE_TRACKING = 0,
|
MENU_STATE_TRACKING = 0,
|
||||||
MENU_STATE_TRACKING_SUBMENU = 1,
|
MENU_STATE_TRACKING_SUBMENU = 1,
|
||||||
@@ -24,6 +26,7 @@ class BBitmap;
|
|||||||
class BMenu;
|
class BMenu;
|
||||||
class BWindow;
|
class BWindow;
|
||||||
|
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
extern const char* kEmptyMenuLabel;
|
extern const char* kEmptyMenuLabel;
|
||||||
@@ -40,7 +43,8 @@ public:
|
|||||||
float FontHeight() const;
|
float FontHeight() const;
|
||||||
float Ascent() const;
|
float Ascent() const;
|
||||||
BRect Padding() const;
|
BRect Padding() const;
|
||||||
void GetItemMargins(float *, float *, float *, float *) const;
|
void GetItemMargins(float*, float*, float*, float*)
|
||||||
|
const;
|
||||||
|
|
||||||
int State(BMenuItem** item = NULL) const;
|
int State(BMenuItem** item = NULL) const;
|
||||||
|
|
||||||
@@ -59,6 +63,7 @@ public:
|
|||||||
static const BBitmap* MenuItemOption();
|
static const BBitmap* MenuItemOption();
|
||||||
static const BBitmap* MenuItemCommand();
|
static const BBitmap* MenuItemCommand();
|
||||||
static const BBitmap* MenuItemMenu();
|
static const BBitmap* MenuItemMenu();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BMenu* fMenu;
|
BMenu* fMenu;
|
||||||
|
|
||||||
@@ -70,18 +75,17 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}; // namespace BPrivate
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Note: since sqrt is slow, we don't use it and return the square of the distance
|
// Note: since sqrt is slow, we don't use it and return the square of the
|
||||||
|
// distance
|
||||||
#define square(x) ((x) * (x))
|
#define square(x) ((x) * (x))
|
||||||
static inline float
|
static inline float
|
||||||
point_distance(const BPoint &pointA, const BPoint &pointB)
|
point_distance(const BPoint &pointA, const BPoint &pointB)
|
||||||
{
|
{
|
||||||
return square(pointA.x - pointB.x) + square(pointA.y - pointB.y);
|
return square(pointA.x - pointB.x) + square(pointA.y - pointB.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef square
|
#undef square
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user