2002-07-09 12:24:59 +00:00
|
|
|
#ifndef OBOS_KEYMAP_WINDOW_H
|
|
|
|
|
#define OBOS_KEYMAP_WINDOW_H
|
|
|
|
|
|
|
|
|
|
|
2002-10-23 20:13:17 +00:00
|
|
|
#include <interface/Window.h>
|
|
|
|
|
#include <support/List.h>
|
|
|
|
|
#include <interface/MenuBar.h>
|
2002-07-09 12:24:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !DEBUG
|
|
|
|
|
#define WINDOW_TITLE "Keymap"
|
|
|
|
|
#else
|
|
|
|
|
#define WINDOW_TITLE "OBOS Keymap"
|
|
|
|
|
#endif //DEBUG
|
|
|
|
|
#define WINDOW_LEFT_TOP_POSITION BPoint( 80, 25 )
|
|
|
|
|
#define WINDOW_DIMENSIONS BRect( 0,0, 612,256 )
|
|
|
|
|
|
|
|
|
|
class KeymapListItem;
|
|
|
|
|
class KeymapApplication;
|
|
|
|
|
|
2004-07-04 18:34:17 +00:00
|
|
|
class MapView : public BView
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
MapView(BRect rect, const char *name);
|
|
|
|
|
void Draw(BRect rect);
|
|
|
|
|
void DrawKey(BRect rect, bool pressed, bool vertical = false);
|
|
|
|
|
void DrawBorder(BRect borderRect);
|
2004-07-04 20:16:21 +00:00
|
|
|
void Pulse();
|
2004-07-04 18:34:17 +00:00
|
|
|
|
2004-07-04 20:16:21 +00:00
|
|
|
key_info fOldKeyInfo;
|
2004-07-04 18:34:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2002-07-09 12:24:59 +00:00
|
|
|
class KeymapWindow : public BWindow {
|
|
|
|
|
public:
|
|
|
|
|
KeymapWindow( BRect frame );
|
|
|
|
|
bool QuitRequested();
|
|
|
|
|
void MessageReceived( BMessage* message );
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
KeymapApplication *fApplication;
|
|
|
|
|
BView *fPlaceholderView;
|
|
|
|
|
BListView *fSystemListView;
|
|
|
|
|
BListView *fUserListView;
|
|
|
|
|
// the map that's currently highlighted
|
|
|
|
|
BEntry *fSelectedMap;
|
|
|
|
|
BButton *fUseButton;
|
|
|
|
|
BButton *fRevertButton;
|
|
|
|
|
const char *title;
|
2004-07-04 18:34:17 +00:00
|
|
|
|
|
|
|
|
MapView *fMapView;
|
2002-07-09 12:24:59 +00:00
|
|
|
|
|
|
|
|
BMenuBar *AddMenuBar();
|
|
|
|
|
void AddMaps();
|
|
|
|
|
BList *ListItemsFromEntryList( BList * entryList);
|
|
|
|
|
KeymapListItem* ItemFromEntry( BEntry *entry );
|
|
|
|
|
void HandleSystemMapSelected( BMessage* );
|
|
|
|
|
void HandleUserMapSelected( BMessage* );
|
|
|
|
|
void HandleMapSelected( BMessage *selectionMessage,
|
|
|
|
|
BListView * selectedView, BListView * otherView );
|
|
|
|
|
void UseKeymap();
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif // OBOS_KEYMAP_WINDOW_H
|