Apply clang-format to source files
This commit is contained in:
parent
fb92169a16
commit
7d897ac09e
@ -16,10 +16,10 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "src/comfortable_swipe.cpp"
|
||||
#include <ios> // std::ios
|
||||
#include <iostream> // std::cin, std::cout, std::cerr
|
||||
#include <string> // std::string
|
||||
#include "src/comfortable_swipe.cpp"
|
||||
|
||||
/* Command-line function. */
|
||||
|
||||
|
||||
@ -39,9 +39,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "service/start.cpp"
|
||||
#include "service/status.cpp"
|
||||
#include "service/stop.cpp"
|
||||
#include "start.cpp"
|
||||
#include "util/autostart_filename.cpp"
|
||||
#include "util/conf_filename.cpp"
|
||||
#include "util/read_config_file.cpp"
|
||||
#include "start.cpp"
|
||||
|
||||
#endif /* __COMFORTABLE_SWIPE__ */
|
||||
|
||||
@ -25,20 +25,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
namespace comfortable_swipe::gesture
|
||||
{
|
||||
class keyboard_swipe_gesture : public swipe_gesture
|
||||
{
|
||||
namespace comfortable_swipe::gesture {
|
||||
class keyboard_swipe_gesture : public swipe_gesture {
|
||||
public:
|
||||
// constructor
|
||||
keyboard_swipe_gesture(
|
||||
const float threshold,
|
||||
const char* left3 /* 000 */,
|
||||
keyboard_swipe_gesture(const float threshold, const char *left3 /* 000 */,
|
||||
const char *left4 /* 001 */,
|
||||
const char *right3 /* 010 */,
|
||||
const char *right4 /* 011 */,
|
||||
const char* up3 /* 100 */,
|
||||
const char* up4 /* 101 */,
|
||||
const char *up3 /* 100 */, const char *up4 /* 101 */,
|
||||
const char *down3 /* 110 */,
|
||||
const char *down4 /* 111 */
|
||||
);
|
||||
@ -75,7 +70,7 @@ namespace comfortable_swipe::gesture
|
||||
static const int MSK_VERTICAL;
|
||||
static const char *const command_map[8];
|
||||
};
|
||||
}
|
||||
} // namespace comfortable_swipe::gesture
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -25,14 +25,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
namespace comfortable_swipe::gesture
|
||||
{
|
||||
class mouse_hold_gesture : public swipe_gesture
|
||||
{
|
||||
namespace comfortable_swipe::gesture {
|
||||
class mouse_hold_gesture : public swipe_gesture {
|
||||
public:
|
||||
// constructor
|
||||
mouse_hold_gesture(
|
||||
const char* hold3, // 3 finger mouse down
|
||||
mouse_hold_gesture(const char *hold3, // 3 finger mouse down
|
||||
const char *hold4 // 4 finger mouse down
|
||||
);
|
||||
|
||||
@ -62,7 +59,7 @@ namespace comfortable_swipe::gesture
|
||||
// flag we can use to check if mouse is down
|
||||
bool flag_mousedown;
|
||||
};
|
||||
}
|
||||
} // namespace comfortable_swipe::gesture
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -25,10 +25,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
namespace comfortable_swipe::gesture
|
||||
{
|
||||
class swipe_gesture : public xdo_gesture
|
||||
{
|
||||
namespace comfortable_swipe::gesture {
|
||||
class swipe_gesture : public xdo_gesture {
|
||||
public:
|
||||
// constructor
|
||||
swipe_gesture();
|
||||
@ -64,7 +62,7 @@ namespace comfortable_swipe::gesture
|
||||
static const char *GESTURE_UPDATE_REGEX_PATTERN;
|
||||
static const char *GESTURE_END_REGEX_PATTERN;
|
||||
};
|
||||
}
|
||||
} // namespace comfortable_swipe::gesture
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -19,8 +19,7 @@ You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
extern "C"
|
||||
{
|
||||
extern "C" {
|
||||
#include <xdo.h> // xdo_t
|
||||
}
|
||||
|
||||
@ -28,12 +27,9 @@ extern "C"
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
namespace comfortable_swipe
|
||||
{
|
||||
namespace gesture
|
||||
{
|
||||
class xdo_gesture
|
||||
{
|
||||
namespace comfortable_swipe {
|
||||
namespace gesture {
|
||||
class xdo_gesture {
|
||||
protected:
|
||||
xdo_t *xdo;
|
||||
|
||||
@ -41,8 +37,8 @@ namespace comfortable_swipe
|
||||
xdo_gesture();
|
||||
virtual ~xdo_gesture();
|
||||
};
|
||||
}
|
||||
}
|
||||
} // namespace gesture
|
||||
} // namespace comfortable_swipe
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -50,7 +50,8 @@ void start() {
|
||||
comfortable_swipe::gesture::mouse_hold_gesture mouse_hold(hold3, hold4);
|
||||
|
||||
// initialize keyboard swipe gesture handler
|
||||
const float threshold = config.count("threshold") ? std::stof(config["threshold"]) : 0.0;
|
||||
const float threshold =
|
||||
config.count("threshold") ? std::stof(config["threshold"]) : 0.0;
|
||||
const char *const left3 = config["left3"].c_str();
|
||||
const char *const left4 = config["left4"].c_str();
|
||||
const char *const right3 = config["right3"].c_str();
|
||||
@ -60,16 +61,7 @@ void start() {
|
||||
const char *const down3 = config["down3"].c_str();
|
||||
const char *const down4 = config["down4"].c_str();
|
||||
comfortable_swipe::gesture::keyboard_swipe_gesture keyboard_swipe(
|
||||
threshold,
|
||||
left3,
|
||||
left4,
|
||||
right3,
|
||||
right4,
|
||||
up3,
|
||||
up4,
|
||||
down3,
|
||||
down4
|
||||
);
|
||||
threshold, left3, left4, right3, right4, up3, up4, down3, down4);
|
||||
|
||||
// prepare data containers
|
||||
std::array<char, 256> line;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user