HAL
v4.5.0-83-g30c8f0afc
The Hardware Analyzer - a comprehensive reverse engineering and manipulation framework for gate-level netlists.
selection_details_icon_provider.h
Go to the documentation of this file.
1
// MIT License
2
//
3
// Copyright (c) 2019 Ruhr University Bochum, Chair for Embedded Security. All Rights reserved.
4
// Copyright (c) 2019 Marc Fyrbiak, Sebastian Wallat, Max Hoffmann ("ORIGINAL AUTHORS"). All rights reserved.
5
// Copyright (c) 2021 Max Planck Institute for Security and Privacy. All Rights reserved.
6
// Copyright (c) 2021 Jörn Langheinrich, Julian Speith, Nils Albartus, René Walendy, Simon Klix ("ORIGINAL AUTHORS"). All Rights reserved.
7
//
8
// Permission is hereby granted, free of charge, to any person obtaining a copy
9
// of this software and associated documentation files (the "Software"), to deal
10
// in the Software without restriction, including without limitation the rights
11
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
// copies of the Software, and to permit persons to whom the Software is
13
// furnished to do so, subject to the following conditions:
14
//
15
// The above copyright notice and this permission notice shall be included in all
16
// copies or substantial portions of the Software.
17
//
18
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
// SOFTWARE.
25
26
#pragma once
27
28
#include "
hal_core/defines.h
"
29
#include "
hal_core/netlist/gate_library/enums/gate_type_property.h
"
30
#include "
gui/settings/settings_items/settings_item_dropdown.h
"
31
#include <QIcon>
32
#include <QHash>
33
#include <QObject>
34
#include <QList>
35
36
namespace
hal
37
{
41
class
SelectionDetailsIconProvider
:
public
QObject
42
{
43
Q_OBJECT
44
45
SelectionDetailsIconProvider
(
QObject
*
parent
=
nullptr
);
46
static
SelectionDetailsIconProvider
* inst;
47
public
:
48
enum
IconCategory
{
ModuleIcon
= -1,
GateIcon
= -2,
NetIcon
= -3,
ViewDir
= -4,
ViewCtx
= -5};
49
enum
IconSize
{
NoIcon
,
SmallIcon
,
BigIcon
};
50
Q_ENUM
(
IconSize
)
51
52
private
Q_SLOTS
:
53
void
loadIcons(
int
istyle);
54
void
handleModuleColorChanged(
u32
id
);
55
private
:
56
QHash<IconCategory,const QIcon*>
mDefaultIcons;
57
QHash<int,const QIcon*>
mGateIcons;
58
QHash<u32,const QIcon*>
mModuleIcons;
59
static
bool
sSettingsInitialized;
60
static
bool
initSettings();
61
public
:
74
const
QIcon
*
getIcon
(
IconCategory
catg,
u32
itemId);
75
82
void
handleModuleRemoved
(
u32
moduleId);
83
89
static
SelectionDetailsIconProvider
*
instance
();
90
94
static
SettingsItemDropdown
*
sIconSizeSetting
;
95
};
96
}
hal::SelectionDetailsIconProvider
Definition:
selection_details_icon_provider.h:42
hal::SelectionDetailsIconProvider::IconSize
IconSize
Definition:
selection_details_icon_provider.h:49
hal::SelectionDetailsIconProvider::NoIcon
@ NoIcon
Definition:
selection_details_icon_provider.h:49
hal::SelectionDetailsIconProvider::BigIcon
@ BigIcon
Definition:
selection_details_icon_provider.h:49
hal::SelectionDetailsIconProvider::SmallIcon
@ SmallIcon
Definition:
selection_details_icon_provider.h:49
hal::SelectionDetailsIconProvider::getIcon
const QIcon * getIcon(IconCategory catg, u32 itemId)
Definition:
selection_details_icon_provider.cpp:95
hal::SelectionDetailsIconProvider::IconCategory
IconCategory
Definition:
selection_details_icon_provider.h:48
hal::SelectionDetailsIconProvider::ModuleIcon
@ ModuleIcon
Definition:
selection_details_icon_provider.h:48
hal::SelectionDetailsIconProvider::ViewCtx
@ ViewCtx
Definition:
selection_details_icon_provider.h:48
hal::SelectionDetailsIconProvider::ViewDir
@ ViewDir
Definition:
selection_details_icon_provider.h:48
hal::SelectionDetailsIconProvider::NetIcon
@ NetIcon
Definition:
selection_details_icon_provider.h:48
hal::SelectionDetailsIconProvider::GateIcon
@ GateIcon
Definition:
selection_details_icon_provider.h:48
hal::SelectionDetailsIconProvider::handleModuleRemoved
void handleModuleRemoved(u32 moduleId)
Definition:
selection_details_icon_provider.cpp:90
hal::SelectionDetailsIconProvider::instance
static SelectionDetailsIconProvider * instance()
Definition:
selection_details_icon_provider.cpp:33
hal::SelectionDetailsIconProvider::sIconSizeSetting
static SettingsItemDropdown * sIconSizeSetting
Definition:
selection_details_icon_provider.h:94
hal::SettingsItemDropdown
A SettingsItem that represents a dropdown menu.
Definition:
settings_item_dropdown.h:40
defines.h
u32
uint32_t u32
Definition:
defines.h:41
gate_type_property.h
hal
Definition:
defines.h:45
QHash< IconCategory, const QIcon * >
QIcon
QObject
QObject::Q_ENUM
Q_ENUM(...)
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::Q_SLOTS
Q_SLOTSQ_SLOTS
QObject::parent
QObject * parent() const const
settings_item_dropdown.h
plugins
gui
include
gui
selection_details_widget
selection_details_icon_provider.h
Generated by
1.9.1