all repos — mgba @ 691600902c18fbee18ba8ab12cefed8403b3c7ae

mGBA Game Boy Advance Emulator

src/platform/qt/library/LibraryGrid.h (view raw)

 1/* Copyright (c) 2014-2017 waddlesplash
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#ifndef QGBA_LIBRARY_GRID
 7#define QGBA_LIBRARY_GRID
 8
 9#include <QListWidget>
10
11#include "LibraryController.h"
12
13namespace QGBA {
14
15class LibraryGrid final : public AbstractGameList {
16public:
17	explicit LibraryGrid(LibraryController* parent = nullptr);
18	~LibraryGrid();
19
20	// AbstractGameList stuff
21	virtual LibraryEntryRef selectedEntry() override;
22	virtual void selectEntry(LibraryEntryRef game) override;
23
24	virtual void setViewStyle(LibraryStyle newStyle) override;
25
26	virtual void addEntry(LibraryEntryRef item) override;
27	virtual void removeEntry(LibraryEntryRef entry) override;
28
29	virtual QWidget* widget() override { return m_widget; }
30
31signals:
32	void startGame();
33
34private:
35	QListWidget* m_widget;
36
37	// Game banner image size
38	const quint32 GRID_BANNER_WIDTH = 320;
39	const quint32 GRID_BANNER_HEIGHT = 240;
40
41	const quint32 ICON_BANNER_WIDTH = 64;
42	const quint32 ICON_BANNER_HEIGHT = 64;
43
44	QMap<LibraryEntryRef, QListWidgetItem*> m_items;
45	LibraryStyle m_currentStyle;
46};
47
48}
49
50#endif