Mouse functions are now in a separate class

This commit is contained in:
Markus Gans 2018-01-14 22:24:15 +01:00
parent 8addcbbcb7
commit afe15753f7
3 changed files with 11 additions and 5 deletions

View File

@ -236,7 +236,7 @@ class FMouseGPM : public FMouse
int stdin_no; int stdin_no;
}; };
#pragma pack(pop) #pragma pack(pop)
#endif
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FMouseGPM::enableGpmMouse() inline bool FMouseGPM::enableGpmMouse()
@ -249,7 +249,7 @@ inline bool FMouseGPM::disableGpmMouse()
//---------------------------------------------------------------------- //----------------------------------------------------------------------
inline bool FMouseGPM::isGpmMouseEnabled() inline bool FMouseGPM::isGpmMouseEnabled()
{ return gpm_mouse_enabled; } { return gpm_mouse_enabled; }
#endif
//---------------------------------------------------------------------- //----------------------------------------------------------------------
// class FMouseX11 // class FMouseX11
@ -498,8 +498,6 @@ class FMouseControl
void drawGpmPointer(); void drawGpmPointer();
private: private:
// Accessor // Accessor
FMouse* getMouseWithData(); FMouse* getMouseWithData();
FMouse* getMouseWithEvent(); FMouse* getMouseWithEvent();

View File

@ -185,7 +185,11 @@ inline FMouse* FMouse::createMouseObject (mouse_type mt)
return 0; return 0;
case gpm: case gpm:
#ifdef F_HAVE_LIBGPM
return new FMouseGPM; return new FMouseGPM;
#else
break;
#endif
case x11: case x11:
return new FMouseX11; return new FMouseX11;
@ -1466,11 +1470,13 @@ void FMouseControl::enable()
{ {
if ( use_gpm_mouse ) if ( use_gpm_mouse )
{ {
#ifdef F_HAVE_LIBGPM
FMouse* mouse = mouse_protocol[FMouse::gpm]; FMouse* mouse = mouse_protocol[FMouse::gpm];
FMouseGPM* gpm_mouse = static_cast<FMouseGPM*>(mouse); FMouseGPM* gpm_mouse = static_cast<FMouseGPM*>(mouse);
if ( gpm_mouse ) if ( gpm_mouse )
use_gpm_mouse = gpm_mouse->enableGpmMouse(); use_gpm_mouse = gpm_mouse->enableGpmMouse();
#endif
} }
if ( use_xterm_mouse ) if ( use_xterm_mouse )
@ -1482,11 +1488,13 @@ void FMouseControl::disable()
{ {
if ( use_gpm_mouse ) if ( use_gpm_mouse )
{ {
#ifdef F_HAVE_LIBGPM
FMouse* mouse = mouse_protocol[FMouse::gpm]; FMouse* mouse = mouse_protocol[FMouse::gpm];
FMouseGPM* gpm_mouse = static_cast<FMouseGPM*>(mouse); FMouseGPM* gpm_mouse = static_cast<FMouseGPM*>(mouse);
if ( gpm_mouse ) if ( gpm_mouse )
gpm_mouse->disableGpmMouse(); gpm_mouse->disableGpmMouse();
#endif
} }
if ( use_xterm_mouse ) if ( use_xterm_mouse )

View File

@ -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) #if defined(__sun) && defined(__SVR4)
tputs (C_STR(s), affcnt, FTerm::putchar_ASCII); tputs (C_STR(s), affcnt, FTerm::putchar_ASCII);