summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-04-01 10:28:03 +0000
committerManolo Gouy <Manolo>2016-04-01 10:28:03 +0000
commitf1a157bdd94c7680629145a577c2ce1d97f2e161 (patch)
tree7b6c5d8a8a4c751f0a923e7c27b558de799d2c53 /src/drivers
parent524ebcef0bd7db2c821414ae7296dd3bb5dfaf9c (diff)
Replace Fl_System_Driver::driver() by Fl::system_driver()
for coherence with the Fl::screen_driver() function. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11494 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Darwin/Fl_Darwin_System_Driver.cxx12
-rw-r--r--src/drivers/Posix/Fl_Posix_System_Driver.cxx11
-rw-r--r--src/drivers/PostScript/Fl_PostScript.cxx2
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx12
4 files changed, 26 insertions, 11 deletions
diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
index d28c8f516..3740e55cf 100644
--- a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
+++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
@@ -40,9 +40,15 @@ const char* fl_local_meta = "⌘\\"; // U+2318 (place of interest sign)
//const char* fl_local_shift = "\xe2\x87\xa7\\"; // U+21E7 (upwards white arrow)
const char* fl_local_shift = "⇧\\"; // U+21E7 (upwards white arrow)
-Fl_System_Driver *Fl_System_Driver::driver() {
- static Fl_System_Driver *d = new Fl_Darwin_System_Driver();
- return d;
+
+/**
+ Creates a driver that manages all screen and display related calls.
+
+ This function must be implemented once for every platform.
+ */
+Fl_System_Driver *Fl_System_Driver::newSystemDriver()
+{
+ return new Fl_Darwin_System_Driver();
}
Fl_Darwin_System_Driver::Fl_Darwin_System_Driver() {
diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.cxx b/src/drivers/Posix/Fl_Posix_System_Driver.cxx
index de156e422..dffedeb93 100644
--- a/src/drivers/Posix/Fl_Posix_System_Driver.cxx
+++ b/src/drivers/Posix/Fl_Posix_System_Driver.cxx
@@ -30,9 +30,14 @@ const char* fl_local_ctrl = "Ctrl";
const char* fl_local_meta = "Meta";
const char* fl_local_shift = "Shift";
-Fl_System_Driver *Fl_System_Driver::driver() {
- static Fl_System_Driver *d = new Fl_Posix_System_Driver();
- return d;
+/**
+ Creates a driver that manages all screen and display related calls.
+
+ This function must be implemented once for every platform.
+ */
+Fl_System_Driver *Fl_System_Driver::newSystemDriver()
+{
+ return new Fl_Posix_System_Driver();
}
void Fl_Posix_System_Driver::display_arg(const char *arg) {
diff --git a/src/drivers/PostScript/Fl_PostScript.cxx b/src/drivers/PostScript/Fl_PostScript.cxx
index d25915a5a..cd5e7d4a1 100644
--- a/src/drivers/PostScript/Fl_PostScript.cxx
+++ b/src/drivers/PostScript/Fl_PostScript.cxx
@@ -145,7 +145,7 @@ int Fl_PostScript_Graphics_Driver::clocale_printf(const char *format, ...)
{
va_list args;
va_start(args, format);
- int retval = Fl_System_Driver::driver()->clocale_printf(output, format, args);
+ int retval = Fl::system_driver()->clocale_printf(output, format, args);
va_end(args);
return retval;
}
diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
index 9f7693da0..3a0b94fc5 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
@@ -39,10 +39,14 @@ static wchar_t *mbwbuf = NULL;
static wchar_t *wbuf = NULL;
static wchar_t *wbuf1 = NULL;
-
-Fl_System_Driver *Fl_System_Driver::driver() {
- static Fl_System_Driver *d = new Fl_WinAPI_System_Driver();
- return d;
+/**
+ Creates a driver that manages all screen and display related calls.
+
+ This function must be implemented once for every platform.
+ */
+Fl_System_Driver *Fl_System_Driver::newSystemDriver()
+{
+ return new Fl_WinAPI_System_Driver();
}
void Fl_WinAPI_System_Driver::warning(const char *format, va_list args) {