ckb-next
v0.2.8 at branch master
ckb-next driver for corsair devices
|
#include <src/ckb/kbperf.h>
Public Types | |
enum | height { LOW = 1, LOWMED, MEDIUM, MEDHIGH, HIGH } |
enum | indicator { NUM, CAPS, SCROLL, HW_IMAX = SCROLL, MODE, MACRO, LIGHT, LOCK, MUTE } |
enum | i_hw { NONE = -1, NORMAL, ON, OFF } |
Signals | |
void | didLoad () |
void | settingsUpdated () |
Public Member Functions | |
KbPerf (KbMode *parent) | |
KbPerf (KbMode *parent, const KbPerf &other) | |
const KbPerf & | operator= (const KbPerf &rhs) |
void | load (CkbSettings &settings) |
void | save (CkbSettings &settings) |
bool | needsSave () const |
height | liftHeight () const |
void | liftHeight (height newHeight) |
bool | angleSnap () const |
void | angleSnap (bool newAngleSnap) |
QPoint | dpi (int index) const |
void | dpi (int index, const QPoint &newValue) |
QPoint | sniperDpi () const |
void | sniperDpi (const QPoint &newValue) |
void | dpi (int index, int newValue) |
void | sniperDpi (int newValue) |
int | baseDpiIdx () const |
void | baseDpiIdx (int newIdx) |
void | dpiUp () |
void | dpiDown () |
void | dpiCycleUp () |
void | dpiCycleDown () |
bool | dpiEnabled (int index) const |
void | dpiEnabled (int index, bool newEnabled) |
quint64 | pushDpi (const QPoint &newDpi) |
quint64 | pushDpi (int newDpi) |
quint64 | pushSniper () |
void | popDpi (quint64 pushIdx) |
float | iOpacity () const |
void | iOpacity (float newIOpacity) |
bool | dpiIndicator () const |
void | dpiIndicator (bool newDpiIndicator) |
QColor | dpiColor (int index) const |
void | dpiColor (int index, const QColor &newColor) |
void | getIndicator (indicator index, QColor &color1, QColor &color2, QColor &color3, bool &software_enable, i_hw &hardware_enable) |
void | setIndicator (indicator index, const QColor &color1, const QColor &color2, const QColor &color3=QColor(), bool software_enable=true, i_hw hardware_enable=NORMAL) |
void | update (QFile &cmd, int notifyNumber, bool force, bool saveCustomDpi) |
void | setNeedsUpdate () |
void | applyIndicators (int modeIndex, const bool indicatorState[HW_I_COUNT]) |
Static Public Attributes | |
static const int | DPI_COUNT = 6 |
static const int | SNIPER = 0 |
static const int | DPI_MIN = 100 |
static const int | DPI_MAX = 12000 |
static const int | OTHER = DPI_COUNT |
static const int | I_COUNT = (int)MUTE + 1 |
static const int | HW_I_COUNT = (int)HW_IMAX + 1 |
Private Member Functions | |
KbMode * | modeParent () const |
KbBind * | bind () const |
KbLight * | light () const |
void | lightIndicator (const char *name, QRgb rgba) |
void | _curDpi (const QPoint &newDpi) |
Private Attributes | |
int | dpiX [DPI_COUNT] |
int | dpiY [DPI_COUNT] |
int | dpiCurX |
int | dpiCurY |
int | dpiBaseIdx |
QColor | dpiClr [DPI_COUNT+1] |
bool | dpiOn [DPI_COUNT] |
QMap< quint64, QPoint > | pushedDpis |
uint | runningPushIdx |
float | _iOpacity |
QColor | iColor [I_COUNT][2] |
QColor | light100Color |
QColor | muteNAColor |
bool | iEnable [I_COUNT] |
i_hw | hwIType [HW_I_COUNT] |
bool | _dpiIndicator |
height | _liftHeight |
bool | _angleSnap |
bool | _needsUpdate |
bool | _needsSave |
enum KbPerf::height |
Enumerator | |
---|---|
LOW | |
LOWMED | |
MEDIUM | |
MEDHIGH | |
HIGH |
Definition at line 31 of file kbperf.h.
enum KbPerf::i_hw |
Enumerator | |
---|---|
NONE | |
NORMAL | |
ON | |
OFF |
enum KbPerf::indicator |
Enumerator | |
---|---|
NUM | |
CAPS | |
SCROLL | |
HW_IMAX | |
MODE | |
MACRO | |
LIGHT | |
LOCK | |
MUTE |
Definition at line 88 of file kbperf.h.
|
explicit |
Definition at line 13 of file kbperf.cpp.
References CAPS, DPI_COUNT, dpiBaseIdx, dpiClr, dpiCurX, dpiCurY, dpiOn, dpiX, dpiY, HW_I_COUNT, hwIType, I_COUNT, iColor, iEnable, LIGHT, light100Color, LOCK, MACRO, MODE, MUTE, muteNAColor, NORMAL, NUM, and SCROLL.
Definition at line 57 of file kbperf.cpp.
References _curDpi(), dpi(), DPI_COUNT, dpiBaseIdx, dpiClr, dpiOn, dpiX, dpiY, hwIType, I_COUNT, iColor, and iEnable.
|
private |
Definition at line 259 of file kbperf.cpp.
References _needsSave, _needsUpdate, dpiCurX, and dpiCurY.
Referenced by baseDpiIdx(), dpi(), KbPerf(), load(), operator=(), popDpi(), and pushDpi().
|
inline |
Definition at line 42 of file kbperf.h.
References _angleSnap.
Referenced by MPerfWidget::on_aSnapBox_clicked(), Kb::readNotify(), and MPerfWidget::setPerf().
void KbPerf::angleSnap | ( | bool | newAngleSnap | ) |
void KbPerf::applyIndicators | ( | int | modeIndex, |
const bool | indicatorState[HW_I_COUNT] | ||
) |
Definition at line 439 of file kbperf.cpp.
References _dpiIndicator, _iOpacity, baseDpiIdx(), bind(), CAPS, dpiClr, getMuteState(), Kb::HWMODE_MAX, iColor, iEnable, LIGHT, light(), light100Color, lightIndicator(), LOCK, MACRO, MODE, MUTE, MUTED, muteNAColor, NUM, OTHER, KbLight::resetIndicators(), SCROLL, and UNMUTED.
Referenced by Kb::frameUpdate().
|
inline |
Definition at line 61 of file kbperf.h.
References dpiBaseIdx.
Referenced by applyIndicators(), dpiCycleDown(), dpiCycleUp(), dpiDown(), dpiUp(), KeyAction::keyEvent(), and Kb::readNotify().
void KbPerf::baseDpiIdx | ( | int | newIdx | ) |
Definition at line 265 of file kbperf.cpp.
References _curDpi(), _needsSave, _needsUpdate, dpi(), dpiBaseIdx, and pushedDpis.
|
private |
Definition at line 98 of file kbperf.cpp.
References KbMode::bind(), and modeParent().
Referenced by applyIndicators().
|
signal |
Definition at line 134 of file moc_kbperf.cpp.
Referenced by load().
|
inline |
Definition at line 50 of file kbperf.h.
References DPI_COUNT, dpiX, and dpiY.
Referenced by baseDpiIdx(), MPerfWidget::boxXChanged(), MPerfWidget::boxYChanged(), KbPerf(), load(), operator=(), popDpi(), Kb::readNotify(), RebindWidget::setBind(), MPerfWidget::setPerf(), MPerfWidget::sliderXMoved(), MPerfWidget::sliderYMoved(), and sniperDpi().
void KbPerf::dpi | ( | int | index, |
const QPoint & | newValue | ||
) |
Definition at line 247 of file kbperf.cpp.
References _curDpi(), _needsSave, _needsUpdate, DPI_COUNT, dpiBaseIdx, dpiX, dpiY, and pushedDpis.
|
inline |
|
inline |
Definition at line 85 of file kbperf.h.
References dpiClr.
Referenced by MPerfWidget::colorChanged(), Kb::readNotify(), MPerfWidget::setPerf(), and update().
|
inline |
void KbPerf::dpiCycleDown | ( | ) |
Definition at line 329 of file kbperf.cpp.
References baseDpiIdx(), DPI_COUNT, dpiOn, and SNIPER.
Referenced by KeyAction::keyEvent().
void KbPerf::dpiCycleUp | ( | ) |
Definition at line 317 of file kbperf.cpp.
References baseDpiIdx(), DPI_COUNT, dpiOn, and SNIPER.
Referenced by KeyAction::keyEvent().
void KbPerf::dpiDown | ( | ) |
Definition at line 306 of file kbperf.cpp.
References baseDpiIdx(), dpiOn, and SNIPER.
Referenced by KeyAction::keyEvent().
|
inline |
Definition at line 68 of file kbperf.h.
References dpiOn.
Referenced by MPerfWidget::enableChanged(), Kb::readNotify(), and MPerfWidget::setPerf().
|
inline |
|
inline |
Definition at line 82 of file kbperf.h.
References _dpiIndicator.
Referenced by MPerfWidget::on_indicBox_clicked(), and MPerfWidget::setPerf().
|
inline |
void KbPerf::dpiUp | ( | ) |
Definition at line 295 of file kbperf.cpp.
References baseDpiIdx(), DPI_COUNT, and dpiOn.
Referenced by KeyAction::keyEvent().
void KbPerf::getIndicator | ( | indicator | index, |
QColor & | color1, | ||
QColor & | color2, | ||
QColor & | color3, | ||
bool & | software_enable, | ||
i_hw & | hardware_enable | ||
) |
Definition at line 341 of file kbperf.cpp.
References HW_IMAX, hwIType, I_COUNT, iColor, iEnable, LIGHT, light100Color, MUTE, muteNAColor, and NONE.
Referenced by KPerfWidget::setPerf().
|
inline |
Definition at line 79 of file kbperf.h.
References _iOpacity.
Referenced by KPerfWidget::on_intensityBox_valueChanged(), MPerfWidget::on_spinBox_valueChanged(), KPerfWidget::setPerf(), and MPerfWidget::setPerf().
|
inline |
|
inline |
Definition at line 38 of file kbperf.h.
References _liftHeight.
Referenced by MPerfWidget::on_lHeightBox_activated(), Kb::readNotify(), and MPerfWidget::setPerf().
void KbPerf::liftHeight | ( | height | newHeight | ) |
Definition at line 373 of file kbperf.cpp.
References _liftHeight, _needsSave, _needsUpdate, and HIGH.
|
private |
Definition at line 102 of file kbperf.cpp.
References KbMode::light(), and modeParent().
Referenced by applyIndicators(), and lightIndicator().
|
private |
Definition at line 432 of file kbperf.cpp.
References _iOpacity, light(), and KbLight::setIndicator().
Referenced by applyIndicators().
void KbPerf::load | ( | CkbSettings & | settings | ) |
Definition at line 106 of file kbperf.cpp.
References _angleSnap, _curDpi(), _dpiIndicator, _iOpacity, _liftHeight, _needsSave, CkbSettings::contains(), CkbSettings::containsGroup(), didLoad(), dpi(), DPI_COUNT, dpiBaseIdx, dpiClr, dpiOn, dpiX, dpiY, HIGH, HW_IMAX, hwIType, I_COUNT, iColor, iEnable, LIGHT, light100Color, LOCK, MACRO, MEDIUM, MODE, MUTE, muteNAColor, NORMAL, OTHER, pushedDpis, runningPushIdx, and CkbSettings::value().
Referenced by KbMode::KbMode().
|
inlineprivate |
|
inline |
Definition at line 28 of file kbperf.h.
References _needsSave.
Referenced by KbMode::needsSave().
Definition at line 77 of file kbperf.cpp.
References _angleSnap, _curDpi(), _dpiIndicator, _iOpacity, _liftHeight, _needsSave, _needsUpdate, dpi(), DPI_COUNT, dpiBaseIdx, dpiClr, dpiCurX, dpiCurY, dpiOn, dpiX, dpiY, hwIType, I_COUNT, iColor, iEnable, light100Color, muteNAColor, and runningPushIdx.
void KbPerf::popDpi | ( | quint64 | pushIdx | ) |
Definition at line 281 of file kbperf.cpp.
References _curDpi(), _needsSave, _needsUpdate, dpi(), dpiBaseIdx, map_last, and pushedDpis.
Referenced by KeyAction::keyEvent().
quint64 KbPerf::pushDpi | ( | const QPoint & | newDpi | ) |
Definition at line 274 of file kbperf.cpp.
References _curDpi(), pushedDpis, and runningPushIdx.
Referenced by KeyAction::keyEvent(), and pushSniper().
|
inline |
|
inline |
Definition at line 75 of file kbperf.h.
References pushDpi(), and sniperDpi().
Referenced by KeyAction::keyEvent().
void KbPerf::save | ( | CkbSettings & | settings | ) |
Definition at line 211 of file kbperf.cpp.
References _angleSnap, _dpiIndicator, _liftHeight, _needsSave, DPI_COUNT, dpiBaseIdx, dpiClr, dpiOn, dpiX, dpiY, HW_IMAX, hwIType, I_COUNT, iColor, iEnable, LIGHT, light100Color, MUTE, muteNAColor, OTHER, and CkbSettings::setValue().
Referenced by KbMode::save().
void KbPerf::setIndicator | ( | indicator | index, |
const QColor & | color1, | ||
const QColor & | color2, | ||
const QColor & | color3 = QColor() , |
||
bool | software_enable = true , |
||
i_hw | hardware_enable = NORMAL |
||
) |
Definition at line 356 of file kbperf.cpp.
References _needsSave, _needsUpdate, HW_IMAX, hwIType, I_COUNT, iColor, iEnable, LIGHT, light100Color, MUTE, muteNAColor, NONE, and NORMAL.
Referenced by KPerfWidget::uiUpdated().
|
inline |
Definition at line 116 of file kbperf.h.
References _needsUpdate.
Referenced by KbMode::setNeedsUpdate().
|
signal |
Definition at line 140 of file moc_kbperf.cpp.
Referenced by update().
|
inline |
Definition at line 52 of file kbperf.h.
Referenced by pushSniper().
|
inline |
|
inline |
Definition at line 56 of file kbperf.h.
References sniperDpi().
Referenced by sniperDpi().
void KbPerf::update | ( | QFile & | cmd, |
int | notifyNumber, | ||
bool | force, | ||
bool | saveCustomDpi | ||
) |
Definition at line 385 of file kbperf.cpp.
References _angleSnap, _liftHeight, _needsUpdate, DPI_COUNT, dpiBaseIdx, dpiColor(), dpiCurX, dpiCurY, dpiOn, dpiX, dpiY, HW_I_COUNT, hwIType, OFF, ON, pushedDpis, and settingsUpdated().
Referenced by Kb::frameUpdate(), and Kb::hwSave().
|
private |
Definition at line 164 of file kbperf.h.
Referenced by angleSnap(), load(), operator=(), save(), and update().
|
private |
Definition at line 160 of file kbperf.h.
Referenced by applyIndicators(), dpiIndicator(), load(), operator=(), and save().
|
private |
Definition at line 155 of file kbperf.h.
Referenced by applyIndicators(), iOpacity(), lightIndicator(), load(), and operator=().
|
private |
Definition at line 163 of file kbperf.h.
Referenced by liftHeight(), load(), operator=(), save(), and update().
|
private |
Definition at line 166 of file kbperf.h.
Referenced by _curDpi(), angleSnap(), baseDpiIdx(), dpi(), dpiColor(), dpiEnabled(), dpiIndicator(), iOpacity(), liftHeight(), load(), needsSave(), operator=(), popDpi(), save(), and setIndicator().
|
private |
Definition at line 166 of file kbperf.h.
Referenced by _curDpi(), angleSnap(), baseDpiIdx(), dpi(), dpiColor(), dpiEnabled(), liftHeight(), operator=(), popDpi(), setIndicator(), setNeedsUpdate(), and update().
|
static |
Definition at line 46 of file kbperf.h.
Referenced by dpi(), dpiCycleDown(), dpiCycleUp(), dpiUp(), KbPerf(), KeyAction::keyEvent(), load(), operator=(), Kb::readNotify(), save(), RebindWidget::setBind(), and update().
|
static |
|
private |
Definition at line 142 of file kbperf.h.
Referenced by baseDpiIdx(), dpi(), KbPerf(), load(), operator=(), popDpi(), save(), and update().
|
private |
Definition at line 143 of file kbperf.h.
Referenced by applyIndicators(), dpiColor(), KbPerf(), load(), operator=(), and save().
|
private |
|
private |
|
private |
Definition at line 144 of file kbperf.h.
Referenced by dpiCycleDown(), dpiCycleUp(), dpiDown(), dpiEnabled(), dpiUp(), KbPerf(), load(), operator=(), save(), and update().
|
private |
|
private |
|
static |
|
private |
Definition at line 159 of file kbperf.h.
Referenced by getIndicator(), KbPerf(), load(), operator=(), save(), setIndicator(), and update().
|
static |
Definition at line 107 of file kbperf.h.
Referenced by getIndicator(), KbPerf(), load(), operator=(), save(), and setIndicator().
|
private |
Definition at line 156 of file kbperf.h.
Referenced by applyIndicators(), getIndicator(), KbPerf(), load(), operator=(), save(), and setIndicator().
|
private |
Definition at line 158 of file kbperf.h.
Referenced by applyIndicators(), getIndicator(), KbPerf(), load(), operator=(), save(), and setIndicator().
|
private |
Definition at line 157 of file kbperf.h.
Referenced by applyIndicators(), getIndicator(), KbPerf(), load(), operator=(), save(), and setIndicator().
|
private |
Definition at line 157 of file kbperf.h.
Referenced by applyIndicators(), getIndicator(), KbPerf(), load(), operator=(), save(), and setIndicator().
|
static |
Definition at line 84 of file kbperf.h.
Referenced by applyIndicators(), MPerfWidget::colorChanged(), load(), save(), and MPerfWidget::setPerf().
|
private |
|
private |
Definition at line 149 of file kbperf.h.
Referenced by load(), operator=(), and pushDpi().
|
static |
Definition at line 46 of file kbperf.h.
Referenced by dpiCycleDown(), dpiCycleUp(), dpiDown(), and sniperDpi().