Remove the Fl_SVG_Image::fl_gzopen() member function that is less useful with the new fl_open_ext() function.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12491 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
b5027d4f29
commit
db83933f58
@ -74,7 +74,6 @@ public:
|
||||
virtual void color_average(Fl_Color c, float i);
|
||||
virtual void draw(int X, int Y, int W, int H, int cx = 0, int cy = 0);
|
||||
void draw(int X, int Y) { draw(X, Y, w(), h(), 0, 0); }
|
||||
static void* fl_gzopen(const char *fname);
|
||||
};
|
||||
|
||||
#endif // FL_SVG_IMAGE_H
|
||||
|
@ -76,24 +76,15 @@ float Fl_SVG_Image::svg_scaling_(int W, int H) {
|
||||
return (f1 < f2) ? f1 : f2;
|
||||
}
|
||||
|
||||
/** Opens for reading a potentially gzip'ed file identified by a UTF-8 encoded filename. */
|
||||
void* Fl_SVG_Image::fl_gzopen(const char *fname) {
|
||||
#if defined(HAVE_LIBZ)
|
||||
int fd = fl_open_ext(fname, 0, 0);
|
||||
if (fd < 0) return NULL;
|
||||
return gzdopen(fd, "r");
|
||||
#else
|
||||
return NULL;
|
||||
#endif // HAVE_LIBZ
|
||||
}
|
||||
|
||||
#if defined(HAVE_LIBZ)
|
||||
|
||||
static char *svg_inflate(const char *fname) {
|
||||
struct stat b;
|
||||
fl_stat(fname, &b);
|
||||
long size = b.st_size;
|
||||
gzFile gzf = (gzFile)Fl_SVG_Image::fl_gzopen(fname);
|
||||
int fd = fl_open_ext(fname, 0, 0);
|
||||
if (fd < 0) return NULL;
|
||||
gzFile gzf = gzdopen(fd, "r");
|
||||
if (!gzf) return NULL;
|
||||
int l;
|
||||
int direct = gzdirect(gzf);
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <FL/Fl_PNG_Image.H>
|
||||
#include <FL/Fl_PNM_Image.H>
|
||||
#include <FL/Fl_SVG_Image.H>
|
||||
#include <FL/fl_utf8.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "flstring.h"
|
||||
@ -94,7 +95,9 @@ fl_check_images(const char *name, // I - Filename
|
||||
#ifdef FLTK_USE_NANOSVG
|
||||
# if defined(HAVE_LIBZ)
|
||||
if (header[0] == 0x1f && header[1] == 0x8b) { // denotes gzip'ed data
|
||||
gzFile gzf = (gzFile)Fl_SVG_Image::fl_gzopen(name);
|
||||
int fd = fl_open_ext(name, 0, 0);
|
||||
if (fd < 0) return NULL;
|
||||
gzFile gzf = gzdopen(fd, "r");
|
||||
if (gzf) {
|
||||
gzread(gzf, header, headerlen);
|
||||
gzclose(gzf);
|
||||
|
Loading…
x
Reference in New Issue
Block a user