Mouse functions are now in a separate class

This commit is contained in:
Markus Gans 2018-01-14 21:53:45 +01:00
parent 48cdd9bb0a
commit 8addcbbcb7
4 changed files with 70 additions and 58 deletions

1
.gitignore vendored
View File

@ -8,6 +8,7 @@
*.gcov
*.gcno
*.gcda
stamp-h1
_configs.sed
config.guess
config.h.in~

View File

@ -3,7 +3,7 @@
* *
* This file is part of the Final Cut widget toolkit *
* *
* Copyright 2013-2017 Markus Gans *
* Copyright 2013-2018 Markus Gans *
* *
* The Final Cut is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public License *

View File

@ -199,7 +199,7 @@ class FMouseGPM : public FMouse
virtual ~FMouseGPM();
// Accessors
const char* getClassName() const;
virtual const char* getClassName() const;
// Mutators
void setStdinNo(int);
@ -238,10 +238,6 @@ class FMouseGPM : public FMouse
#pragma pack(pop)
#endif
//----------------------------------------------------------------------
inline const char* FMouseGPM::getClassName() const
{ return "FMouseGPM"; }
//----------------------------------------------------------------------
inline bool FMouseGPM::enableGpmMouse()
{ return gpmMouse(true); }
@ -272,7 +268,7 @@ class FMouseX11 : public FMouse
virtual ~FMouseX11();
// Accessors
const char* getClassName() const;
virtual const char* getClassName() const;
// Inquiry
virtual bool hasData();
@ -317,10 +313,6 @@ class FMouseX11 : public FMouse
};
#pragma pack(pop)
//----------------------------------------------------------------------
inline const char* FMouseX11::getClassName() const
{ return "FMouseX11"; }
//----------------------------------------------------------------------
// class FMouseSGR
@ -339,7 +331,7 @@ class FMouseSGR : public FMouse
virtual ~FMouseSGR();
// Accessors
const char* getClassName() const;
virtual const char* getClassName() const;
// Inquiry
virtual bool hasData();
@ -384,10 +376,6 @@ class FMouseSGR : public FMouse
};
#pragma pack(pop)
//----------------------------------------------------------------------
inline const char* FMouseSGR::getClassName() const
{ return "FMouseSGR"; }
//----------------------------------------------------------------------
// class FMouseUrxvt
@ -406,7 +394,7 @@ class FMouseUrxvt : public FMouse
virtual ~FMouseUrxvt();
// Accessors
const char* getClassName() const;
virtual const char* getClassName() const;
// Inquiry
virtual bool hasData();
@ -451,10 +439,6 @@ class FMouseUrxvt : public FMouse
};
#pragma pack(pop)
//----------------------------------------------------------------------
inline const char* FMouseUrxvt::getClassName() const
{ return "FMouseUrxvt"; }
//----------------------------------------------------------------------
// class FMouseControl
@ -472,7 +456,7 @@ class FMouseControl
virtual ~FMouseControl();
// Accessors
const char* getClassName() const;
virtual const char* getClassName() const;
FPoint& getPos();
void clearEvent();
@ -514,8 +498,7 @@ class FMouseControl
void drawGpmPointer();
private:
std::map<FMouse::mouse_type, FMouse*> mouse_protocol;
std::map<FMouse::mouse_type, FMouse*>::iterator iter;
// Accessor
FMouse* getMouseWithData();
@ -523,6 +506,8 @@ class FMouseControl
void putstring (const char[], int = 1);
// Data Member
std::map<FMouse::mouse_type, FMouse*> mouse_protocol;
std::map<FMouse::mouse_type, FMouse*>::iterator iter;
FPoint zero_point;
bool use_gpm_mouse;
bool use_xterm_mouse;

View File

@ -238,6 +238,12 @@ FMouseGPM::~FMouseGPM() // destructor
// public methods of FMouseX11
//----------------------------------------------------------------------
const char* FMouseGPM::getClassName() const
{
return "FMouseGPM";
}
//----------------------------------------------------------------------
void FMouseGPM::setStdinNo (int file_descriptor)
{
@ -459,6 +465,12 @@ FMouseX11::~FMouseX11() // destructor
// public methods of FMouseX11
//----------------------------------------------------------------------
const char* FMouseX11::getClassName() const
{
return "FMouseX11";
}
//----------------------------------------------------------------------
bool FMouseX11::hasData()
{
@ -653,6 +665,12 @@ FMouseSGR::~FMouseSGR() // destructor
// public methods of FMouseSGR
//----------------------------------------------------------------------
const char* FMouseSGR::getClassName() const
{
return "FMouseSGR";
}
//----------------------------------------------------------------------
bool FMouseSGR::hasData()
{
@ -896,6 +914,12 @@ FMouseUrxvt::~FMouseUrxvt() // destructor
// public methods of FMouseUrxvt
//----------------------------------------------------------------------
const char* FMouseUrxvt::getClassName() const
{
return "FMouseUrxvt";
}
//----------------------------------------------------------------------
bool FMouseUrxvt::hasData()
{
@ -1148,7 +1172,9 @@ void FMouseUrxvt::setButtonState (int button, struct timeval* time)
// constructors and destructor
//----------------------------------------------------------------------
FMouseControl::FMouseControl()
: zero_point(0,0)
: mouse_protocol()
, iter()
, zero_point(0,0)
, use_gpm_mouse(false)
, use_xterm_mouse(false)
{