From afe15753f78c5cb5ad7081e91057403c48afadc6 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sun, 14 Jan 2018 22:24:15 +0100 Subject: [PATCH] Mouse functions are now in a separate class --- include/final/fmouse.h | 6 ++---- src/fmouse.cpp | 8 ++++++++ src/fterm.cpp | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/include/final/fmouse.h b/include/final/fmouse.h index 74b2f71b..cdd0f272 100644 --- a/include/final/fmouse.h +++ b/include/final/fmouse.h @@ -236,7 +236,7 @@ class FMouseGPM : public FMouse int stdin_no; }; #pragma pack(pop) -#endif + //---------------------------------------------------------------------- inline bool FMouseGPM::enableGpmMouse() @@ -249,7 +249,7 @@ inline bool FMouseGPM::disableGpmMouse() //---------------------------------------------------------------------- inline bool FMouseGPM::isGpmMouseEnabled() { return gpm_mouse_enabled; } - +#endif //---------------------------------------------------------------------- // class FMouseX11 @@ -498,8 +498,6 @@ class FMouseControl void drawGpmPointer(); private: - - // Accessor FMouse* getMouseWithData(); FMouse* getMouseWithEvent(); diff --git a/src/fmouse.cpp b/src/fmouse.cpp index 01685549..1a2caa14 100644 --- a/src/fmouse.cpp +++ b/src/fmouse.cpp @@ -185,7 +185,11 @@ inline FMouse* FMouse::createMouseObject (mouse_type mt) return 0; case gpm: +#ifdef F_HAVE_LIBGPM return new FMouseGPM; +#else + break; +#endif case x11: return new FMouseX11; @@ -1466,11 +1470,13 @@ void FMouseControl::enable() { if ( use_gpm_mouse ) { +#ifdef F_HAVE_LIBGPM FMouse* mouse = mouse_protocol[FMouse::gpm]; FMouseGPM* gpm_mouse = static_cast(mouse); if ( gpm_mouse ) use_gpm_mouse = gpm_mouse->enableGpmMouse(); +#endif } if ( use_xterm_mouse ) @@ -1482,11 +1488,13 @@ void FMouseControl::disable() { if ( use_gpm_mouse ) { +#ifdef F_HAVE_LIBGPM FMouse* mouse = mouse_protocol[FMouse::gpm]; FMouseGPM* gpm_mouse = static_cast(mouse); if ( gpm_mouse ) gpm_mouse->disableGpmMouse(); +#endif } if ( use_xterm_mouse ) diff --git a/src/fterm.cpp b/src/fterm.cpp index ed6df4de..ec329adb 100644 --- a/src/fterm.cpp +++ b/src/fterm.cpp @@ -1533,7 +1533,7 @@ void FTerm::putstringf (const char format[], ...) } //---------------------------------------------------------------------- -inline void FTerm::putstring (const char s[], int affcnt) +void FTerm::putstring (const char s[], int affcnt) { #if defined(__sun) && defined(__SVR4) tputs (C_STR(s), affcnt, FTerm::putchar_ASCII);