Begin to remove platform-dependent code from Fl_Input_.cxx

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11485 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2016-03-31 15:57:35 +00:00
parent 56e145a1c8
commit ff83e355b0
4 changed files with 9 additions and 6 deletions

View File

@ -89,6 +89,8 @@ public:
virtual void repeat_timeout(double time, Fl_Timeout_Handler cb, void *argp) = 0;
virtual int has_timeout(Fl_Timeout_Handler cb, void *argp) = 0;
virtual void remove_timeout(Fl_Timeout_Handler cb, void *argp) = 0;
static int secret_input_character;
};

View File

@ -19,6 +19,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Input_.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Screen_Driver.H>
#include <FL/fl_draw.H>
#include <FL/fl_ask.H>
#include <math.h>
@ -35,11 +36,6 @@
#define MAXBUF 1024
#if defined(USE_X11) && !USE_XFT
const int secret_char = '*'; // asterisk to hide secret input
#else
const int secret_char = 0x2022; // bullet to hide secret input
#endif
static int l_secret;
extern void fl_draw(const char*, int, float, float);
@ -72,7 +68,7 @@ const char* Fl_Input_::expand(const char* p, char* buf) const {
if (input_type()==FL_SECRET_INPUT) {
while (o<e && p < value_+size_) {
if (fl_utf8len((char)p[0]) >= 1) {
l_secret = fl_utf8encode(secret_char, o);
l_secret = fl_utf8encode(Fl_Screen_Driver::secret_input_character, o);
o += l_secret;
}
p++;

View File

@ -142,6 +142,8 @@ const char *Fl_Screen_Driver::get_system_scheme()
return 0L;
}
/** The bullet character used by default by Fl_Secret_Input */
int Fl_Screen_Driver::secret_input_character = 0x2022;
//
// End of "$Id$".

View File

@ -102,6 +102,9 @@ static double missed_timeout_by;
*/
Fl_Screen_Driver *Fl_Screen_Driver::newScreenDriver()
{
#if !USE_XFT
secret_input_character = '*';
#endif
return new Fl_X11_Screen_Driver();
}