core: Add clang-tidy (#8664)

This adds a .clang-tidy file for us.

It's not a strict requirement to be compliant, but I tuned it to be alright.
This commit is contained in:
Vaxry 2024-12-07 18:51:18 +01:00 committed by GitHub
parent b1e5cc66bd
commit 8bbeee1173
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
118 changed files with 720 additions and 679 deletions

View file

@ -70,5 +70,4 @@ void CInputManager::recheckIdleInhibitorStatus() {
}
PROTO::idle->setInhibit(false);
return;
}

View file

@ -868,7 +868,7 @@ void CInputManager::newVirtualKeyboard(SP<CVirtualKeyboardV1Resource> keyboard)
void CInputManager::setupKeyboard(SP<IKeyboard> keeb) {
static auto PDPMS = CConfigValue<Hyprlang::INT>("misc:key_press_enables_dpms");
m_vHIDs.push_back(keeb);
m_vHIDs.emplace_back(keeb);
try {
keeb->hlName = getNameForNewDevice(keeb->deviceName);
@ -1016,7 +1016,7 @@ void CInputManager::newMouse(SP<Aquamarine::IPointer> mouse) {
}
void CInputManager::setupMouse(SP<IPointer> mauz) {
m_vHIDs.push_back(mauz);
m_vHIDs.emplace_back(mauz);
try {
mauz->hlName = getNameForNewDevice(mauz->deviceName);
@ -1495,7 +1495,7 @@ void CInputManager::disableAllKeyboards(bool virt) {
void CInputManager::newTouchDevice(SP<Aquamarine::ITouch> pDevice) {
const auto PNEWDEV = m_vTouches.emplace_back(CTouchDevice::create(pDevice));
m_vHIDs.push_back(PNEWDEV);
m_vHIDs.emplace_back(PNEWDEV);
try {
PNEWDEV->hlName = getNameForNewDevice(PNEWDEV->deviceName);

View file

@ -26,12 +26,12 @@ AQUAMARINE_FORWARD(ITablet);
AQUAMARINE_FORWARD(ITabletTool);
AQUAMARINE_FORWARD(ITabletPad);
enum eClickBehaviorMode {
enum eClickBehaviorMode : uint8_t {
CLICKMODE_DEFAULT = 0,
CLICKMODE_KILL
};
enum eMouseBindMode {
enum eMouseBindMode : int8_t {
MBIND_INVALID = -1,
MBIND_MOVE = 0,
MBIND_RESIZE = 1,
@ -39,8 +39,8 @@ enum eMouseBindMode {
MBIND_RESIZE_FORCE_RATIO = 3
};
enum eBorderIconDirection {
BORDERICON_NONE,
enum eBorderIconDirection : uint8_t {
BORDERICON_NONE = 0,
BORDERICON_UP,
BORDERICON_DOWN,
BORDERICON_LEFT,
@ -276,7 +276,7 @@ class CInputManager {
void setCursorImageOverride(const std::string& name);
// cursor surface
struct cursorSI {
struct {
bool hidden = false; // null surface = hidden
SP<CWLSurface> wlSurface;
Vector2D vHotspot;
@ -288,8 +288,8 @@ class CInputManager {
// discrete scrolling emulation using v120 data
struct {
bool lastEventSign = 0;
bool lastEventAxis = 0;
bool lastEventSign = false;
bool lastEventAxis = false;
uint32_t lastEventTime = 0;
uint32_t accumulatedScroll = 0;
} m_ScrollWheelState;

View file

@ -198,7 +198,7 @@ void CInputManager::onTabletProximity(CTablet::SProximityEvent e) {
void CInputManager::newTablet(SP<Aquamarine::ITablet> pDevice) {
const auto PNEWTABLET = m_vTablets.emplace_back(CTablet::create(pDevice));
m_vHIDs.push_back(PNEWTABLET);
m_vHIDs.emplace_back(PNEWTABLET);
try {
PNEWTABLET->hlName = g_pInputManager->getNameForNewDevice(pDevice->getName());
@ -226,7 +226,7 @@ SP<CTabletTool> CInputManager::ensureTabletToolPresent(SP<Aquamarine::ITabletToo
}
const auto PTOOL = m_vTabletTools.emplace_back(CTabletTool::create(pTool));
m_vHIDs.push_back(PTOOL);
m_vHIDs.emplace_back(PTOOL);
try {
PTOOL->hlName = g_pInputManager->getNameForNewDevice(pTool->getName());
@ -246,7 +246,7 @@ SP<CTabletTool> CInputManager::ensureTabletToolPresent(SP<Aquamarine::ITabletToo
void CInputManager::newTabletPad(SP<Aquamarine::ITabletPad> pDevice) {
const auto PNEWPAD = m_vTabletPads.emplace_back(CTabletPad::create(pDevice));
m_vHIDs.push_back(PNEWPAD);
m_vHIDs.emplace_back(PNEWPAD);
try {
PNEWPAD->hlName = g_pInputManager->getNameForNewDevice(pDevice->getName());

View file

@ -63,11 +63,10 @@ void CTextInput::onEnabled(SP<CWLSurfaceResource> surfV1) {
// v1 only, map surface to PTI
if (!isV3()) {
SP<CWLSurfaceResource> pSurface = surfV1;
if (g_pCompositor->m_pLastFocus != pSurface || !pV1Input->active)
if (g_pCompositor->m_pLastFocus != surfV1 || !pV1Input->active)
return;
enter(pSurface);
enter(surfV1);
}
g_pInputManager->m_sIMERelay.activateIME(this);