From 5e6bf76b0a75f84dcdaa277d1aef7ab76e2d0631 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 4 Oct 2017 11:46:33 +0000 Subject: 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 --- src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx') 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 #endif +#if defined(HAVE_LIBZ) +# include +#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$". // -- cgit v1.2.3