summaryrefslogtreecommitdiff
path: root/src/drivers/WinAPI
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2017-10-04 11:46:33 +0000
committerManolo Gouy <Manolo>2017-10-04 11:46:33 +0000
commit5e6bf76b0a75f84dcdaa277d1aef7ab76e2d0631 (patch)
treea6b337e3d88fc23fe1941e09d22a0b28f5e31223 /src/drivers/WinAPI
parent6434d5d602344631cef2a75c015fa9e72035852d (diff)
Fl_SVG_Image class: add support for compressed .svgz image files.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12475 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/WinAPI')
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_System_Driver.H1
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx16
2 files changed, 17 insertions, 0 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
index 43e0f54e2..99b5b0871 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
+++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
@@ -117,6 +117,7 @@ public:
virtual void remove_fd(int, int when);
virtual void remove_fd(int);
virtual void gettime(time_t *sec, int *usec);
+ virtual void* gzopen(const char *fname, const char *mode);
};
#endif // FL_WINAPI_SYSTEM_DRIVER_H
diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
index efbe65d01..b0a4c52e1 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
@@ -50,6 +50,9 @@ typedef RPC_STATUS (WINAPI* uuid_func)(UUID __RPC_FAR *Uuid);
#ifdef __CYGWIN__
# include <mntent.h>
#endif
+#if defined(HAVE_LIBZ)
+# include <zlib.h>
+#endif
inline int isdirsep(char c) { return c == '/' || c == '\\'; }
@@ -908,6 +911,19 @@ void Fl_WinAPI_System_Driver::gettime(time_t *sec, int *usec) {
*usec = t.millitm * 1000;
}
+void* Fl_WinAPI_System_Driver::gzopen(const char *fname, const char *mode) {
+#if defined(HAVE_LIBZ)
+ unsigned wl = fl_utf8towc(fname, strlen(fname), NULL, 0) + 1;
+ wchar_t *wc = new wchar_t[wl];
+ fl_utf8towc(fname, strlen(fname), wc, wl);
+ gzFile gzf = gzopen_w(wc, mode);
+ delete[] wc;
+ return gzf;
+#else
+ return NULL;
+#endif
+}
+
//
// End of "$Id$".
//