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,65 +26,67 @@ class BBitmap;
|
|||||||
class BMenu;
|
class BMenu;
|
||||||
class BWindow;
|
class BWindow;
|
||||||
|
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
extern const char *kEmptyMenuLabel;
|
extern const char* kEmptyMenuLabel;
|
||||||
|
|
||||||
class MenuPrivate {
|
class MenuPrivate {
|
||||||
public:
|
public:
|
||||||
MenuPrivate(BMenu *menu);
|
MenuPrivate(BMenu* menu);
|
||||||
|
|
||||||
menu_layout Layout() const;
|
|
||||||
|
|
||||||
void ItemMarked(BMenuItem *item);
|
menu_layout Layout() const;
|
||||||
void CacheFontInfo();
|
|
||||||
|
|
||||||
float FontHeight() const;
|
|
||||||
float Ascent() const;
|
|
||||||
BRect Padding() const;
|
|
||||||
void GetItemMargins(float *, float *, float *, float *) const;
|
|
||||||
|
|
||||||
int State(BMenuItem **item = NULL) const;
|
void ItemMarked(BMenuItem* item);
|
||||||
|
void CacheFontInfo();
|
||||||
void Install(BWindow *window);
|
|
||||||
void Uninstall();
|
float FontHeight() const;
|
||||||
void SetSuper(BMenu *menu);
|
float Ascent() const;
|
||||||
void SetSuperItem(BMenuItem *item);
|
BRect Padding() const;
|
||||||
void InvokeItem(BMenuItem *item, bool now = false);
|
void GetItemMargins(float*, float*, float*, float*)
|
||||||
void QuitTracking(bool thisMenuOnly = true);
|
const;
|
||||||
|
|
||||||
static status_t CreateBitmaps();
|
int State(BMenuItem** item = NULL) const;
|
||||||
static void DeleteBitmaps();
|
|
||||||
|
void Install(BWindow* window);
|
||||||
|
void Uninstall();
|
||||||
|
void SetSuper(BMenu* menu);
|
||||||
|
void SetSuperItem(BMenuItem* item);
|
||||||
|
void InvokeItem(BMenuItem* item, bool now = false);
|
||||||
|
void QuitTracking(bool thisMenuOnly = true);
|
||||||
|
|
||||||
|
static status_t CreateBitmaps();
|
||||||
|
static void DeleteBitmaps();
|
||||||
|
|
||||||
|
static const BBitmap* MenuItemShift();
|
||||||
|
static const BBitmap* MenuItemControl();
|
||||||
|
static const BBitmap* MenuItemOption();
|
||||||
|
static const BBitmap* MenuItemCommand();
|
||||||
|
static const BBitmap* MenuItemMenu();
|
||||||
|
|
||||||
static const BBitmap *MenuItemShift();
|
|
||||||
static const BBitmap *MenuItemControl();
|
|
||||||
static const BBitmap *MenuItemOption();
|
|
||||||
static const BBitmap *MenuItemCommand();
|
|
||||||
static const BBitmap *MenuItemMenu();
|
|
||||||
private:
|
private:
|
||||||
BMenu *fMenu;
|
BMenu* fMenu;
|
||||||
|
|
||||||
static BBitmap *sMenuItemShift;
|
static BBitmap* sMenuItemShift;
|
||||||
static BBitmap *sMenuItemControl;
|
static BBitmap* sMenuItemControl;
|
||||||
static BBitmap *sMenuItemOption;
|
static BBitmap* sMenuItemOption;
|
||||||
static BBitmap *sMenuItemAlt;
|
static BBitmap* sMenuItemAlt;
|
||||||
static BBitmap *sMenuItemMenu;
|
static BBitmap* sMenuItemMenu;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
}; // 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
|
||||||
|
|
||||||
|
|
||||||
#endif // __MENU_PRIVATE_H
|
#endif // __MENU_PRIVATE_H
|
||||||
|
|||||||
Reference in New Issue
Block a user