summaryrefslogtreecommitdiff
path: root/src/fl_encoding_latin1.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-04-13 14:05:34 +0000
committerManolo Gouy <Manolo>2016-04-13 14:05:34 +0000
commitb590bc49f9dc2f33ebc51026bf1d7a7e519de4ad (patch)
tree7e3c0a66ea91c6ea240c60ecc96de36a6e937b1d /src/fl_encoding_latin1.cxx
parenta1ffa85a1ee978c2ee75526c68a16a4bfec6dab5 (diff)
Rewrite fl_encoding_latin1.cxx under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11599 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_encoding_latin1.cxx')
-rw-r--r--src/fl_encoding_latin1.cxx29
1 files changed, 21 insertions, 8 deletions
diff --git a/src/fl_encoding_latin1.cxx b/src/fl_encoding_latin1.cxx
index f7adc3459..9e3d16cfc 100644
--- a/src/fl_encoding_latin1.cxx
+++ b/src/fl_encoding_latin1.cxx
@@ -16,13 +16,17 @@
// http://www.fltk.org/str.php
//
+#include "config_lib.h"
#include <FL/fl_draw.H>
+#include <FL/Fl.H>
+#include <FL/Fl_System_Driver.H>
#include <FL/Enumerations.H>
#include <stdlib.h>
#include "flstring.h"
-#ifdef __APPLE__ // PORTME: Fl_Screen_Driver - platform text encoding
-
+#ifdef FL_CFG_WIN_COCOA
+#include "drivers/Darwin/Fl_Darwin_System_Driver.H"
+
// These function assume a western code page. If you need to support
// scripts that are not part of this code page, you might want to
// take a look at FLTK2, which uses utf8 for text encoding.
@@ -67,7 +71,7 @@ static uchar roman2latin[128] = {
static char *buf = 0;
static int n_buf = 0;
-const char *fl_latin1_to_local(const char *t, int n)
+const char *Fl_Darwin_System_Driver::latin1_to_local(const char *t, int n)
{
if (n==-1) n = strlen(t);
if (n<=n_buf) {
@@ -88,7 +92,7 @@ const char *fl_latin1_to_local(const char *t, int n)
return buf;
}
-const char *fl_local_to_latin1(const char *t, int n)
+const char *Fl_Darwin_System_Driver::local_to_latin1(const char *t, int n)
{
if (n==-1) n = strlen(t);
if (n<=n_buf) {
@@ -109,19 +113,28 @@ const char *fl_local_to_latin1(const char *t, int n)
return buf;
}
-#else
+#endif
-const char *fl_latin1_to_local(const char *t, int)
+const char *Fl_System_Driver::latin1_to_local(const char *t, int)
{
return t;
}
-const char *fl_local_to_latin1(const char *t, int)
+const char *Fl_System_Driver::local_to_latin1(const char *t, int)
{
return t;
}
-#endif
+const char *fl_latin1_to_local(const char *t, int n)
+{
+ return Fl::system_driver()->latin1_to_local(t, n);
+}
+
+const char *fl_local_to_latin1(const char *t, int n)
+{
+ return Fl::system_driver()->local_to_latin1(t, n);
+}
+
//
// End of "$Id$".