* style adjustments - no functional change

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38201 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe
2010-08-17 16:53:25 +00:00
parent 1195f511e5
commit e0ae658ae2
+88 -86
View File
@@ -11,113 +11,115 @@
#include "KeyboardLayout.h" #include "KeyboardLayout.h"
class Keymap; class Keymap;
class KeyboardLayoutView : public BView { class KeyboardLayoutView : public BView {
public: public:
KeyboardLayoutView(const char* name); KeyboardLayoutView(const char* name);
~KeyboardLayoutView(); ~KeyboardLayoutView();
void SetKeyboardLayout(KeyboardLayout* layout); void SetKeyboardLayout(KeyboardLayout* layout);
void SetKeymap(Keymap* keymap); void SetKeymap(Keymap* keymap);
void SetTarget(BMessenger target); void SetTarget(BMessenger target);
KeyboardLayout* GetKeyboardLayout() { return fLayout; } KeyboardLayout* GetKeyboardLayout() { return fLayout; }
void SetFont(const BFont& font); void SetFont(const BFont& font);
void SetEditable(bool editable); void SetEditable(bool editable);
protected: protected:
virtual void AttachedToWindow(); virtual void AttachedToWindow();
virtual void FrameResized(float width, float height); virtual void FrameResized(float width, float height);
virtual BSize MinSize(); virtual BSize MinSize();
virtual void KeyDown(const char* bytes, int32 numBytes); virtual void KeyDown(const char* bytes, int32 numBytes);
virtual void KeyUp(const char* bytes, int32 numBytes); virtual void KeyUp(const char* bytes, int32 numBytes);
virtual void MouseDown(BPoint point); virtual void MouseDown(BPoint point);
virtual void MouseUp(BPoint point); virtual void MouseUp(BPoint point);
virtual void MouseMoved(BPoint point, uint32 transit, virtual void MouseMoved(BPoint point, uint32 transit,
const BMessage* dragMessage); const BMessage* dragMessage);
virtual void Draw(BRect updateRect); virtual void Draw(BRect updateRect);
virtual void MessageReceived(BMessage* message); virtual void MessageReceived(BMessage* message);
virtual void WindowActivated(bool active); virtual void WindowActivated(bool active);
private: private:
enum key_kind { enum key_kind {
kNormalKey, kNormalKey,
kSpecialKey, kSpecialKey,
kSymbolKey, kSymbolKey,
kIndicator kIndicator
}; };
void _InitOffscreen(); void _InitOffscreen();
void _LayoutKeyboard(); void _LayoutKeyboard();
void _DrawKeyButton(BView* view, BRect& rect, void _DrawKeyButton(BView* view, BRect& rect,
BRect updateRect, rgb_color base, BRect updateRect, rgb_color base,
rgb_color background, bool pressed); rgb_color background, bool pressed);
void _DrawKey(BView* view, BRect updateRect, void _DrawKey(BView* view, BRect updateRect,
const Key* key, BRect frame, bool pressed); const Key* key, BRect frame, bool pressed);
void _DrawIndicator(BView* view, BRect updateRect, void _DrawIndicator(BView* view, BRect updateRect,
const Indicator* indicator, BRect rect, const Indicator* indicator, BRect rect,
bool lit); bool lit);
const char* _SpecialKeyLabel(const key_map& map, uint32 code, const char* _SpecialKeyLabel(const key_map& map,
bool abbreviated = false); uint32 code, bool abbreviated = false);
const char* _SpecialMappedKeySymbol(const char* bytes, const char* _SpecialMappedKeySymbol(const char* bytes,
size_t numBytes); size_t numBytes);
const char* _SpecialMappedKeyLabel(const char* bytes, const char* _SpecialMappedKeyLabel(const char* bytes,
size_t numBytes, bool abbreviated = false); size_t numBytes, bool abbreviated = false);
bool _FunctionKeyLabel(uint32 code, char* text, bool _FunctionKeyLabel(uint32 code, char* text,
size_t textSize); size_t textSize);
void _GetAbbreviatedKeyLabelIfNeeded(BView* view, void _GetAbbreviatedKeyLabelIfNeeded(BView* view,
BRect rect, const Key* key, char* text, BRect rect, const Key* key, char* text,
size_t textSize); size_t textSize);
void _GetKeyLabel(const Key* key, char* text, void _GetKeyLabel(const Key* key, char* text,
size_t textSize, key_kind& keyKind); size_t textSize, key_kind& keyKind);
bool _IsKeyPressed(uint32 code); bool _IsKeyPressed(uint32 code);
bool _KeyState(uint32 code) const; bool _KeyState(uint32 code) const;
void _SetKeyState(uint32 code, bool pressed); void _SetKeyState(uint32 code, bool pressed);
Key* _KeyForCode(uint32 code); Key* _KeyForCode(uint32 code);
void _InvalidateKey(uint32 code); void _InvalidateKey(uint32 code);
void _InvalidateKey(const Key* key); void _InvalidateKey(const Key* key);
bool _HandleDeadKey(uint32 key, int32 modifiers); bool _HandleDeadKey(uint32 key, int32 modifiers);
void _KeyChanged(const BMessage* message); void _KeyChanged(const BMessage* message);
Key* _KeyAt(BPoint point); Key* _KeyAt(BPoint point);
BRect _FrameFor(BRect keyFrame); BRect _FrameFor(BRect keyFrame);
BRect _FrameFor(const Key* key); BRect _FrameFor(const Key* key);
void _SetFontSize(BView* view, key_kind keyKind); void _SetFontSize(BView* view, key_kind keyKind);
void _EvaluateDropTarget(BPoint point); void _EvaluateDropTarget(BPoint point);
void _SendFakeKeyDown(const Key* key); void _SendFakeKeyDown(const Key* key);
BBitmap* fOffscreenBitmap; BBitmap* fOffscreenBitmap;
BView* fOffscreenView; BView* fOffscreenView;
KeyboardLayout* fLayout; KeyboardLayout* fLayout;
Keymap* fKeymap; Keymap* fKeymap;
BMessenger fTarget; BMessenger fTarget;
bool fEditable; bool fEditable;
uint8 fKeyState[16]; uint8 fKeyState[16];
int32 fModifiers; int32 fModifiers;
int32 fDeadKey; int32 fDeadKey;
int32 fButtons; int32 fButtons;
BPoint fClickPoint; BPoint fClickPoint;
Key* fDragKey; Key* fDragKey;
int32 fDragModifiers; int32 fDragModifiers;
Key* fDropTarget; Key* fDropTarget;
BPoint fDropPoint; BPoint fDropPoint;
BSize fOldSize; BSize fOldSize;
BFont fFont; BFont fFont;
BFont fSpecialFont; BFont fSpecialFont;
float fBaseFontHeight; float fBaseFontHeight;
float fBaseFontSize; float fBaseFontSize;
BPoint fOffset; BPoint fOffset;
float fFactor; float fFactor;
float fGap; float fGap;
}; };
#endif // KEYBOARD_LAYOUT_VIEW_H #endif // KEYBOARD_LAYOUT_VIEW_H