[med-svn] [Git][med-team/seaview][master] 7 commits: New upstream version 5.0.5
Andreas Tille (@tille)
gitlab at salsa.debian.org
Thu Feb 3 15:09:31 GMT 2022
Andreas Tille pushed to branch master at Debian Med / seaview
Commits:
d3aaf676 by Andreas Tille at 2022-02-03T15:47:33+01:00
New upstream version 5.0.5
- - - - -
376ef7df by Andreas Tille at 2022-02-03T15:47:33+01:00
routine-update: New upstream version
- - - - -
ef01f41d by Andreas Tille at 2022-02-03T15:47:35+01:00
Update upstream source from tag 'upstream/5.0.5'
Update to upstream version '5.0.5'
with Debian dir 92302c7c9d7fa8db1ada7d08eed003008bc06ca5
- - - - -
2905ef16 by Andreas Tille at 2022-02-03T15:47:35+01:00
routine-update: Standards-Version: 4.6.0
- - - - -
b65609af by Andreas Tille at 2022-02-03T15:47:44+01:00
Avoid explicitly specifying -Wl,--as-needed linker flag.
Changes-By: lintian-brush
Fixes: lintian: debian-rules-uses-as-needed-linker-flag
See-also: https://lintian.debian.org/tags/debian-rules-uses-as-needed-linker-flag.html
- - - - -
c385f637 by Andreas Tille at 2022-02-03T16:01:24+01:00
Drop now unneeded patch
- - - - -
3c998a6f by Andreas Tille at 2022-02-03T16:02:34+01:00
Upload to unstable
- - - - -
22 changed files:
- Makefile
- csrc/dnapars.c
- csrc/phylip.c
- csrc/phylip.h
- csrc/protpars.c
- csrc/zsockr.c
- debian/changelog
- debian/control
- − debian/patches/fix-gcc10.patch
- − debian/patches/series
- debian/rules
- macos_extras.mm
- pdf_or_ps.cxx
- pdf_or_ps.h
- seaview.html
- svg.cxx
- svg.h
- treedraw.cxx
- treerecs_draw.cxx
- unrooted.cxx
- use_mase_files.cxx
- xfmatpt.cxx
Changes:
=====================================
Makefile
=====================================
@@ -43,7 +43,7 @@ pseudoterminal.o unrooted.o pdf_or_ps.o svg.o threads.o tbe.o treerecs_draw.o Fl
COBJECTS = raa_acnuc.o parser.o md5.o zsockr.o misc_acnuc.o dnapars.o protpars.o seq.o phylip.o lwl.o bionj.o phyml_util.o
seaview : $(OBJECTS) $(COBJECTS)
- $(CXX) -o $@ $(DEBUG) $(LDFLAGS) $(OBJECTS) $(COBJECTS) $(LPDF) $(EXTRALIBS)
+ $(CXX) -o $@ $(DEBUG) $(LDFLAGS) $(OBJECTS) $(COBJECTS) $(LPDF) $(EXTRALIBS) -Wl,-z,muldefs
Fl_SVG_Image.o : FL/Fl_SVG_Image.cxx
$(CXX) -c $(SVFLAGS) FL/Fl_SVG_Image.cxx
=====================================
csrc/dnapars.c
=====================================
@@ -77,41 +77,41 @@ void load_tree(long treei);
/* function prototypes */
-Char infilename[FNMLNGTH], outfilename[FNMLNGTH], intreename[FNMLNGTH], *outtreename,
+static Char infilename[FNMLNGTH], outfilename[FNMLNGTH], intreename[FNMLNGTH], *outtreename,
weightfilename[FNMLNGTH];
char basechar[32]="ACMGRSVTWYHKDBNO???????????????";
-node *root;
-long chars, col, msets, ith, njumble, jumb, maxtrees;
+static node *root;
+static long chars, col, msets, ith, njumble, jumb, maxtrees;
/* chars = number of sites in actual sequences */
-long inseed, inseed0;
-double threshold;
-boolean jumble, usertree, thresh, weights, thorough, rearrfirst,
+static long inseed, inseed0;
+static double threshold;
+static boolean jumble, usertree, thresh, weights, thorough, rearrfirst,
trout, progress, stepbox, ancseq, mulsets, justwts, firstset, mulf,
multf;
steptr oldweight;
-longer seed;
-pointarray treenode; /* pointers to all nodes in tree */
-long *enterorder;
+static longer seed;
+static pointarray treenode; /* pointers to all nodes in tree */
+static long *enterorder;
long *zeros;
/* local variables for Pascal maketree, propagated globally for C version: */
-long minwhich;
+static long minwhich;
static double like, minsteps, bestyet, bestlike, bstlike2;
-boolean lastrearr, recompute;
-double nsteps[maxuser];
-long **fsteps;
-node *there, *oldnufork;
-long *place;
-bestelm *bestrees;
-long *threshwt;
+static boolean lastrearr, recompute;
+static double nsteps[maxuser];
+static long **fsteps;
+static node *there, *oldnufork;
+static long *place;
+static bestelm *bestrees;
+static long *threshwt;
baseptr nothing;
-gbases *garbage;
-node *temp, *temp1, *temp2, *tempsum, *temprm, *tempadd, *tempf, *tmp, *tmp1,
+static gbases *garbage;
+static node *temp, *temp1, *temp2, *tempsum, *temprm, *tempadd, *tempf, *tmp, *tmp1,
*tmp2, *tmp3, *tmprm, *tmpadd;
-boolean *names;
+static boolean *names;
node *grbg;
-char *progname;
+static char *progname;
static void getoptions(int arg_maxtrees, dnapars_S_option s_option)
=====================================
csrc/phylip.c
=====================================
@@ -143,7 +143,7 @@ void init(int argc, char** argv)
/* Set default terminal characteristics */
ibmpc = IBMCRT;
ansi = ANSICRT;
- javarun = false;
+ //javarun = false;
/* Clear the screen */
cleerhome();
=====================================
csrc/phylip.h
=====================================
@@ -342,7 +342,7 @@ MALLOCRETURN *mymalloc(long);
/* Lower-triangular format. */
#define MAT_LOWERTRI (MAT_LOWER | MAT_MACHINE)
-boolean javarun;
+//boolean javarun;
typedef long *steptr;
typedef long longer[6];
@@ -363,7 +363,7 @@ extern long spp, words, bits;
extern boolean ibmpc, ansi, tranvsp;
//extern naym *nayme; /* names of species */
extern char* *nayme; /* names of species */
-boolean firstplotblock; // for debugging BMP output
+//boolean firstplotblock; // for debugging BMP output
#define ebcdic EBCDIC
=====================================
csrc/protpars.c
=====================================
@@ -104,39 +104,39 @@ extern void awake_from_C(void);
-Char infilename[FNMLNGTH], outfilename[FNMLNGTH], intreename[FNMLNGTH], *outtreename, weightfilename[FNMLNGTH];
-node *root;
-long chars, col, msets, ith, njumble, jumb;
+static Char infilename[FNMLNGTH], outfilename[FNMLNGTH], intreename[FNMLNGTH], *outtreename, weightfilename[FNMLNGTH];
+static node *root;
+static long chars, col, msets, ith, njumble, jumb;
/* chars = number of sites in actual sequences */
-long inseed, inseed0;
-boolean jumble, usertree, weights, thresh, trout, progress, stepbox,
+static long inseed, inseed0;
+static boolean jumble, usertree, weights, thresh, trout, progress, stepbox,
justwts, ancseq, mulsets, firstset;
codetype whichcode;
long fullset, fulldel;
-pointarray treenode; /* pointers to all nodes in tree */
-double threshold;
-steptr threshwt;
-longer seed;
-long *enterorder;
+static pointarray treenode; /* pointers to all nodes in tree */
+static double threshold;
+static steptr threshwt;
+static longer seed;
+static long *enterorder;
sitearray translate[(long)quest - (long)ala + 1];
aas trans[4][4][4];
-long **fsteps;
-bestelm *bestrees;
+static long **fsteps;
+static bestelm *bestrees;
boolean dummy;
-gseq *garbage;
-node *temp, *temp1;
+static gseq *garbage;
+static node *temp, *temp1;
Char ch;
aas tmpa;
-char *progname;
+static char *progname;
/* Local variables for maketree, propagated globally for c version: */
-long minwhich;
+static long minwhich;
static double like, bestyet, bestlike, minsteps, bstlike2;
-boolean lastrearr, recompute;
-node *there;
-double nsteps[maxuser];
-long *place;
-boolean *names;
+static boolean lastrearr, recompute;
+static node *there;
+static double nsteps[maxuser];
+static long *place;
+static boolean *names;
/*void protgnu(gseq **p)
=====================================
csrc/zsockr.c
=====================================
@@ -1,14 +1,14 @@
/* functions to handle zlib-compressed data read from socket
*/
-#include <stdio.h>//essai
-#include <stdlib.h>//essai
-#include <zlib.h>
+//#include <zlib.h>
#include <unistd.h>
-//#include <stdio.h>
+#include <stdlib.h>
+#include <stdio.h>
#include <string.h>
#ifdef WIN32
#include <winsock.h>
#endif
+#include <zlib.h>
/* included functions */
=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+seaview (1:5.0.5-1) unstable; urgency=medium
+
+ * New upstream version
+ * Standards-Version: 4.6.0 (routine-update)
+ * Avoid explicitly specifying -Wl,--as-needed linker flag.
+
+ -- Andreas Tille <tille at debian.org> Thu, 03 Feb 2022 16:01:36 +0100
+
seaview (1:5.0.4-1) unstable; urgency=medium
* Team Upload.
=====================================
debian/control
=====================================
@@ -11,7 +11,7 @@ Build-Depends: debhelper-compat (= 13),
libxext-dev,
libxinerama-dev,
zlib1g-dev
-Standards-Version: 4.5.0
+Standards-Version: 4.6.0
Vcs-Browser: https://salsa.debian.org/med-team/seaview
Vcs-Git: https://salsa.debian.org/med-team/seaview.git
Homepage: https://doua.prabi.fr/software/seaview
=====================================
debian/patches/fix-gcc10.patch deleted
=====================================
@@ -1,101 +0,0 @@
-Author: Nilesh Patra <npatra974 at gmail.com>
-Description: Append relevant attribute flag to prevent gcc-10 FTBFS
-Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?archive=no&bug=957783
-Last-Updated: July 28, 2020
-
---- a/csrc/dnapars.c
-+++ b/csrc/dnapars.c
-@@ -77,41 +77,41 @@
- /* function prototypes */
-
-
--Char infilename[FNMLNGTH], outfilename[FNMLNGTH], intreename[FNMLNGTH], *outtreename,
-+__attribute__((__common__)) Char infilename[FNMLNGTH], outfilename[FNMLNGTH], intreename[FNMLNGTH], *outtreename,
- weightfilename[FNMLNGTH];
- char basechar[32]="ACMGRSVTWYHKDBNO???????????????";
--node *root;
--long chars, col, msets, ith, njumble, jumb, maxtrees;
-+extern node *root;
-+__attribute__((__common__)) long chars, col, msets, ith, njumble, jumb, maxtrees;
- /* chars = number of sites in actual sequences */
--long inseed, inseed0;
--double threshold;
--boolean jumble, usertree, thresh, weights, thorough, rearrfirst,
-+extern long inseed, inseed0;
-+extern double threshold;
-+__attribute__((__common__)) boolean jumble, usertree, thresh, weights, thorough, rearrfirst,
- trout, progress, stepbox, ancseq, mulsets, justwts, firstset, mulf,
- multf;
- steptr oldweight;
--longer seed;
--pointarray treenode; /* pointers to all nodes in tree */
--long *enterorder;
-+extern longer seed;
-+extern pointarray treenode; /* pointers to all nodes in tree */
-+extern long *enterorder;
- long *zeros;
-
- /* local variables for Pascal maketree, propagated globally for C version: */
-
--long minwhich;
-+extern long minwhich;
- static double like, minsteps, bestyet, bestlike, bstlike2;
--boolean lastrearr, recompute;
--double nsteps[maxuser];
--long **fsteps;
--node *there, *oldnufork;
--long *place;
--bestelm *bestrees;
--long *threshwt;
-+extern boolean lastrearr, recompute;
-+extern double nsteps[maxuser];
-+extern long **fsteps;
-+__attribute__((__common__)) node *there, *oldnufork;
-+extern long *place;
-+extern bestelm *bestrees;
-+extern long *threshwt;
- baseptr nothing;
--gbases *garbage;
--node *temp, *temp1, *temp2, *tempsum, *temprm, *tempadd, *tempf, *tmp, *tmp1,
-+__attribute__((__common__)) gbases *garbage;
-+__attribute__((__common__)) node *temp, *temp1, *temp2, *tempsum, *temprm, *tempadd, *tempf, *tmp, *tmp1,
- *tmp2, *tmp3, *tmprm, *tmpadd;
--boolean *names;
-+extern boolean *names;
- node *grbg;
--char *progname;
-+__attribute__((__common__)) char *progname;
-
-
- static void getoptions(int arg_maxtrees, dnapars_S_option s_option)
---- a/csrc/protpars.c
-+++ b/csrc/protpars.c
-@@ -127,7 +127,7 @@
- node *temp, *temp1;
- Char ch;
- aas tmpa;
--char *progname;
-+__attribute__((__common__)) char *progname;
-
- /* Local variables for maketree, propagated globally for c version: */
- long minwhich;
---- a/csrc/phylip.h
-+++ b/csrc/phylip.h
-@@ -342,7 +342,7 @@
- /* Lower-triangular format. */
- #define MAT_LOWERTRI (MAT_LOWER | MAT_MACHINE)
-
--boolean javarun;
-+__attribute__((__common__)) boolean javarun;
-
- typedef long *steptr;
- typedef long longer[6];
-@@ -363,7 +363,7 @@
- extern boolean ibmpc, ansi, tranvsp;
- //extern naym *nayme; /* names of species */
- extern char* *nayme; /* names of species */
--boolean firstplotblock; // for debugging BMP output
-+extern boolean firstplotblock; // for debugging BMP output
-
- #define ebcdic EBCDIC
-
=====================================
debian/patches/series deleted
=====================================
@@ -1 +0,0 @@
-fix-gcc10.patch
=====================================
debian/rules
=====================================
@@ -9,7 +9,6 @@ CFLAGS += -DDEFAULT_HELPFILE=\"/usr/share/seaview/seaview.html\" -DPHYMLNAME=\"
export DEB_CFLAGS_MAINT_APPEND = $(CFLAGS) -fPIC
# Link as needed
-export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
# Hardening options
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
=====================================
macos_extras.mm
=====================================
@@ -97,22 +97,22 @@ char *mac_GetOutputFName_Plus(const char *dfault, const char *message, int use_o
NSString *dir = [[NSString alloc] initWithUTF8String:directory];
NSString *preset = [[NSString alloc] initWithUTF8String:dfault];
NSString *fname = [preset lastPathComponent];
- NSRect rectview = {{0, 0}, {500, 65} };
+ NSRect rectview = {{0, 0}, {513, 65} };
NSView *view = [[[NSView alloc] initWithFrame:rectview] autorelease];
//blocksize
- label(12, 15, 45, 30, "block\nsize:", view);
- NSRect rectblock = {{50, 20}, {35, 20} };
+ label(5, 28, 75, 15, "block size:", view);
+ NSRect rectblock = {{68, 25}, {35, 20} };
NSTextField *blockview = [[[NSTextField alloc] initWithFrame:rectblock] autorelease];
[view addSubview:blockview];
[blockview setIntValue:printout_block];
//fontsize
- label(102, 15, 45, 30, "font\nsize:", view);
- NSRect rectfont = {{140, 20}, {35, 20} };
+ label(109, 28, 75, 15, "font size:", view);
+ NSRect rectfont = {{165, 25}, {35, 20} };
NSTextField *fontview = [[[NSTextField alloc] initWithFrame:rectfont] autorelease];
[view addSubview:fontview];
[fontview setIntValue:printout_fontsize];
//color
- NSRect pdfrect = {{190, -10}, {80, 70} };
+ NSRect pdfrect = {{215, -10}, {80, 70} };
NSMatrix *pdfmatrix = [[[NSMatrix alloc] initWithFrame:pdfrect mode:NSRadioModeMatrix
cellClass:[NSButtonCell class]
numberOfRows:3 numberOfColumns:1] autorelease];
@@ -137,7 +137,7 @@ char *mac_GetOutputFName_Plus(const char *dfault, const char *message, int use_o
if([pdfmatrix selectedRow] != printout_black) [pdfmatrix selectCellAtRow:printout_black column:0];
[view addSubview:pdfmatrix];
//paper format
- NSRect paperrect = {{280, -10}, {80, 70} };
+ NSRect paperrect = {{305, -10}, {80, 70} };
NSMatrix *papermatrix = [[[NSMatrix alloc] initWithFrame:paperrect mode:NSRadioModeMatrix
cellClass:[NSButtonCell class]
numberOfRows:2 numberOfColumns:1] autorelease];
@@ -157,7 +157,7 @@ char *mac_GetOutputFName_Plus(const char *dfault, const char *message, int use_o
if ([papermatrix selectedRow] != desired_paper_cell) [papermatrix selectCellAtRow:desired_paper_cell column:0];
[view addSubview:papermatrix];
// landscape button
- NSRect landscaperect = {{280, 6}, {80, 20} };
+ NSRect landscaperect = {{305, 6}, {80, 20} };
NSButton *landscape = [[[NSButton alloc] initWithFrame:landscaperect] autorelease];
[landscape setButtonType:switch_button_style];
[landscape setTitle:@"landscape"];
@@ -166,7 +166,7 @@ char *mac_GetOutputFName_Plus(const char *dfault, const char *message, int use_o
[landscape setEnabled:YES];
[view addSubview:landscape];
//variable site button
- NSRect variablerect = {{360, 30}, {80, 20} };
+ NSRect variablerect = {{385, 25}, {80, 20} };
NSButton *variable = [[[NSButton alloc] initWithFrame:variablerect] autorelease];
[variable setButtonType:switch_button_style];
[variable setTitle:@"variable sites only"];
@@ -608,140 +608,6 @@ void mac_tmp_dir_name(char *buffer, int l)
#include <FL/Fl_PostScript.H>
-class EPS_File_Surface : public Fl_Widget_Surface {
-protected:
- inline Fl_PostScript_Graphics_Driver *driver() { return (Fl_PostScript_Graphics_Driver*)Fl_Surface_Device::driver(); }
-public:
- EPS_File_Surface(const char *filename, int width, int height, Fl_Color background = FL_WHITE);
- ~EPS_File_Surface();
- int start_eps(int width, int height);
- virtual int printable_rect(int *w, int *h);
- FILE *file() { return driver()->output; }
- virtual void origin(int x, int y);
- virtual void origin(int *px, int *py);
- virtual void translate(int x, int y);
- virtual void untranslate();
-};
-
-EPS_File_Surface::EPS_File_Surface(const char *filename, int width, int height, Fl_Color background) :
- Fl_Widget_Surface(new Fl_PostScript_Graphics_Driver()) {
- Fl_PostScript_Graphics_Driver *ps = driver();
- ps->output = fl_fopen(filename, "w+");
- if (ps->output) {
- ps->ps_filename_ = strdup(filename);
- float s = Fl::screen_scale(0);
- start_eps(width*s, height*s);
- if (s != 1) {
- ps->clocale_printf("GR GR GS %f %f SC GS\n", s, s);
- ps->scale_x = ps->scale_y = s;
- }
- Fl::get_color(background, ps->bg_r, ps->bg_g, ps->bg_b);
- }
-}
-
-EPS_File_Surface::~EPS_File_Surface() {
- Fl_PostScript_Graphics_Driver *ps = driver();
- if(ps->output == NULL) return;
- fputs("GR\nend %matches begin of FLTK dict\n", ps->output);
- fputs("restore\n", ps->output);
- fputs("%%EOF\n", ps->output);
- ps->reset();
- fflush(ps->output);
- if(ferror(ps->output)) {
- fl_alert ("Error during PostScript data output.");
- }
- fclose(ps->output);
- while (ps->clip_){
- Fl_PostScript_Graphics_Driver::Clip * c= ps->clip_;
- ps->clip_= ps->clip_->prev;
- delete c;
- }
-}
-
-int EPS_File_Surface::start_eps(int width, int height) {
- Fl_PostScript_Graphics_Driver *ps = driver();
- ps->width_ = width;
- ps->height_ = height;
- fputs("%!PS-Adobe-3.0 EPSF-3.0\n", file());
- fputs("%%Creator: (FLTK)\n", file());
- fprintf(file(),"%%%%BoundingBox: 1 1 %d %d\n", width, height);
- if (ps->ps_filename_) fprintf(file(),"%%%%Title: (%s)\n", fl_filename_name(ps->ps_filename_));
- time_t lt = time(NULL);
- fprintf(file(),"%%%%CreationDate: %s", ctime(<)+4);
- ps->lang_level_= 2;
- fprintf(file(), "%%%%LanguageLevel: 2\n");
- fputs("%%Pages: 1\n%%EndComments\n", file());
- fputs("%%BeginProlog\n", file());
- fputs("%%EndProlog\n",file());
- fprintf(file(), "save\n");
- fputs("/FLTK 20 dict def FLTK begin\n"
- "/x1 0 def /x2 0 def /y1 0 def /y2 0 def /x 0 def /y 0 def /dx 0 def /dy 0 def\n"
- "/px 0 def /py 0 def /sx 0 def /sy 0 def /inter 0 def\n"
- "/pixmap_sx 0 def /pixmap_sy 0 def /pixmap_w 0 def /pixmap_h 0 def\n", file());
- // trick to get the prolog
- long cur_pos = ftell(file());
- Fl_PostScript_File_Device *tmp = new Fl_PostScript_File_Device();
- tmp->begin_job(file());
- tmp->end_job();
- delete tmp;
- fseek(file(), cur_pos, SEEK_SET);
- char line[200];
- do fgets(line, sizeof(line), file());
- while(strncmp(line, "%%BeginProlog\n", 14));
- char *prolog = new char[10000], *p = prolog;
- while (1) {
- fgets(line, sizeof(line), file());
- if (strncmp(line, "/CS { GS } bind def\n", 20) == 0) break;
- strcpy(p, line);
- p += strlen(p);
- }
- int lprolog = strlen(prolog);
- fseek(file(), cur_pos, SEEK_SET);
- fwrite(prolog, 1, lprolog, file());
- delete[] prolog;
- // end of trick
- fputs("/CS { GS } bind def\n", file());
- fputs("/CR { GR } bind def\n", file());
- ps->page_policy_ = 1;
- ps->reset();
- ps->nPages=0;
- fprintf(file(), "GS\n");
- ps->clocale_printf( "%g %g TR\n", (double)0, ps->height_);
- fprintf(file(), "1 -1 SC\n");
- ps->line_style(0);
- fprintf(file(), "GS GS\n");
- return 0;
-}
-
-int EPS_File_Surface::printable_rect(int *w, int *h) {
- Fl_PostScript_Graphics_Driver *ps = driver();
- *w = ps->width_;
- *h = ps->height_;
- return 0;
-}
-
-void EPS_File_Surface::origin(int x, int y)
-{
- x_offset = x;
- y_offset = y;
- driver()->clocale_printf("GR GR GS %d %d TR %f %f SC %d %d TR %f rotate GS\n",
- 0, 0, driver()->scale_x, driver()->scale_y, x, y, 0);
-}
-
-void EPS_File_Surface::origin(int *px, int *py) {
- Fl_Widget_Surface::origin(px, py);
-}
-
-void EPS_File_Surface::translate(int x, int y)
-{
- fprintf(file(), "GS %d %d translate GS\n", x, y);
-}
-
-void EPS_File_Surface::untranslate()
-{
- fprintf(file(), "GR GR\n");
-}
-
void EPS_cb(Fl_Widget *, void *data) {
Fl_Native_File_Chooser fnfc;
fnfc.title("Pick an .eps file");
@@ -750,8 +616,9 @@ void EPS_cb(Fl_Widget *, void *data) {
if (!fnfc.show() ) {
Fl_Window *target = Fl::first_window();
if (target) {
- EPS_File_Surface p(fnfc.filename(), target->decorated_w(), target->decorated_h());
- if (p.file()) {
+ FILE *file = fl_fopen(fnfc.filename(), "w");
+ if (file) {
+ Fl_EPS_File_Surface p(target->decorated_w(), target->decorated_h(), file);
p.draw_decorated_window(target);
}
}
=====================================
pdf_or_ps.cxx
=====================================
@@ -5,14 +5,16 @@
#include <FL/Fl_Paged_Device.H>
#include <FL/fl_ask.H>
#include <ctype.h>
+#include <stdlib.h>
extern char *run_and_close_native_file_chooser(Fl_Native_File_Chooser *chooser, int keepalive=0);
extern char *prepare_ps_or_pdf_font(int font_num);
extern const char *extract_filename(const char *fname);
#ifdef NO_PDF
+#include <stdlib.h>
-int Fl_PDF_or_PS_File_Device::begin_document(const char* fixedfilename, enum Fl_Paged_Device::Page_Format format,
+int PDF_or_PS_File_Device::begin_document(const char* fixedfilename, enum Fl_Paged_Device::Page_Format format,
enum Fl_Paged_Device::Page_Layout layout)
{
file = fopen(fixedfilename, "w");
@@ -21,7 +23,7 @@ int Fl_PDF_or_PS_File_Device::begin_document(const char* fixedfilename, enum Fl_
return Fl_PostScript_File_Device::start_job(file, 0, format, layout);
}
-int Fl_PDF_or_PS_File_Device::start_job(const char *defaultname, enum Fl_Paged_Device::Page_Format format, enum Fl_Paged_Device::Page_Layout layout)
+int PDF_or_PS_File_Device::start_job(const char *defaultname, enum Fl_Paged_Device::Page_Format format, enum Fl_Paged_Device::Page_Layout layout)
{
Fl_Native_File_Chooser *chooser = new Fl_Native_File_Chooser();
chooser->type(Fl_Native_File_Chooser::BROWSE_SAVE_FILE);
@@ -41,7 +43,7 @@ int Fl_PDF_or_PS_File_Device::start_job(const char *defaultname, enum Fl_Paged_D
return begin_document(plotfilename, format, layout);
}
-Fl_PDF_or_PS_File_Device::~Fl_PDF_or_PS_File_Device()
+PDF_or_PS_File_Device::~PDF_or_PS_File_Device()
{
if (file) {
fclose(file); free(filename);
@@ -65,13 +67,13 @@ extern void win32_PDF_delete(PDF *p);
Fl_PDF_File_Device::Fl_PDF_File_Device()
{
- driver(new Fl_PDF_Graphics_Driver);
+ driver(new PDF_Graphics_Driver);
filename = NULL;
}
Fl_PDF_File_Device::~Fl_PDF_File_Device()
{
- PDF *p = ((Fl_PDF_Graphics_Driver*)driver())->pdf;
+ PDF *p = ((PDF_Graphics_Driver*)driver())->pdf;
if (p) PDF_delete(p);
delete driver();
if (filename) free(filename);
@@ -113,7 +115,7 @@ int Fl_PDF_File_Device::begin_custom(const char* plotfilename, int pwidth, int p
height = pheight;
PDF *pdf = PDF_new();
if (pdf == NULL) return 1;
- Fl_PDF_Graphics_Driver *d = (Fl_PDF_Graphics_Driver*)driver();
+ PDF_Graphics_Driver *d = (PDF_Graphics_Driver*)driver();
d->pdf = pdf;
if (PDF_begin_document(pdf, plotfilename, 0, "compatibility=1.3") == -1) {
fl_alert("Error opening %s for writing\n", plotfilename);
@@ -138,7 +140,7 @@ int Fl_PDF_File_Device::begin_custom(const char* plotfilename, int pwidth, int p
int Fl_PDF_File_Device::start_page()
{
- Fl_PDF_Graphics_Driver *d = (Fl_PDF_Graphics_Driver*)driver();
+ PDF_Graphics_Driver *d = (PDF_Graphics_Driver*)driver();
PDF *p = d->pdf;
PDF_begin_page_ext(p, width, height, "");
PDF_translate(p, left_margin, top_margin);
@@ -171,7 +173,7 @@ void Fl_PDF_File_Device::margins(int *left, int *top, int *right, int *bottom)
void Fl_PDF_File_Device::origin(int x, int y)
{
- Fl_PDF_Graphics_Driver *d = (Fl_PDF_Graphics_Driver*)driver();
+ PDF_Graphics_Driver *d = (PDF_Graphics_Driver*)driver();
d->tr_x = x;
d->tr_y = y;
PDF *p = d->pdf;
@@ -182,14 +184,14 @@ void Fl_PDF_File_Device::origin(int x, int y)
void Fl_PDF_File_Device::origin(int *px, int *py)
{
- Fl_PDF_Graphics_Driver *d = (Fl_PDF_Graphics_Driver*)driver();
+ PDF_Graphics_Driver *d = (PDF_Graphics_Driver*)driver();
if (px) *px = d->tr_x;
if (py) *py = d->tr_y;
}
void Fl_PDF_File_Device::translate(int x, int y)
{
- Fl_PDF_Graphics_Driver *d = (Fl_PDF_Graphics_Driver*)driver();
+ PDF_Graphics_Driver *d = (PDF_Graphics_Driver*)driver();
PDF *p = d->pdf;
PDF_save(p);
PDF_translate(p, x, y);
@@ -197,14 +199,14 @@ void Fl_PDF_File_Device::translate(int x, int y)
void Fl_PDF_File_Device::untranslate()
{
- Fl_PDF_Graphics_Driver *d = (Fl_PDF_Graphics_Driver*)driver();
+ PDF_Graphics_Driver *d = (PDF_Graphics_Driver*)driver();
PDF *p = d->pdf;
PDF_restore(p);
}
int Fl_PDF_File_Device::end_page()
{
- Fl_PDF_Graphics_Driver *d = (Fl_PDF_Graphics_Driver*)driver();
+ PDF_Graphics_Driver *d = (PDF_Graphics_Driver*)driver();
PDF_restore(d->pdf);
PDF_end_page_ext(d->pdf, "");
d->in_page = false;
@@ -213,13 +215,13 @@ int Fl_PDF_File_Device::end_page()
void Fl_PDF_File_Device::end_job()
{
- PDF_end_document(((Fl_PDF_Graphics_Driver*)driver())->pdf, "");
+ PDF_end_document(((PDF_Graphics_Driver*)driver())->pdf, "");
previous_surface->set_current();
}
void *Fl_PDF_File_Device::pdf()
{
- return ((Fl_PDF_Graphics_Driver*)driver())->pdf;
+ return ((PDF_Graphics_Driver*)driver())->pdf;
}
void Fl_PDF_File_Device::error_catch()
@@ -233,17 +235,17 @@ void Fl_PDF_File_Device::error_catch()
int Fl_PDF_File_Device::surface_catch()
{
- return pdf_catch(((Fl_PDF_Graphics_Driver*)driver())->pdf);
+ return pdf_catch(((PDF_Graphics_Driver*)driver())->pdf);
}
void Fl_PDF_File_Device::surface_try(jmp_buf **jbuf)
{
- PDF *p = ((Fl_PDF_Graphics_Driver*)driver())->pdf;
+ PDF *p = ((PDF_Graphics_Driver*)driver())->pdf;
*jbuf = &( pdf_jbuf(p)->jbuf );
}
-Fl_PDF_Graphics_Driver::Fl_PDF_Graphics_Driver()
+PDF_Graphics_Driver::PDF_Graphics_Driver()
{
#ifdef __APPLE__
encoding = "macroman";
@@ -255,49 +257,49 @@ Fl_PDF_Graphics_Driver::Fl_PDF_Graphics_Driver()
in_page = false;
}
-void Fl_PDF_Graphics_Driver::line(int x1, int y1, int x2, int y2)
+void PDF_Graphics_Driver::line(int x1, int y1, int x2, int y2)
{
PDF_moveto(pdf, x1, y1);
PDF_lineto(pdf, x2, y2);
PDF_stroke(pdf);
}
-void Fl_PDF_Graphics_Driver::xyline(int x, int y, int x1)
+void PDF_Graphics_Driver::xyline(int x, int y, int x1)
{
line(x, y, x1, y);
}
-void Fl_PDF_Graphics_Driver::xyline(int x, int y, int x1, int y2)
+void PDF_Graphics_Driver::xyline(int x, int y, int x1, int y2)
{
line(x, y, x1, y);
line(x1,y,x1,y2);
}
-void Fl_PDF_Graphics_Driver::yxline(int x, int y, int y1)
+void PDF_Graphics_Driver::yxline(int x, int y, int y1)
{
line(x, y, x, y1);
}
-void Fl_PDF_Graphics_Driver::yxline(int x, int y, int y1, int x2)
+void PDF_Graphics_Driver::yxline(int x, int y, int y1, int x2)
{
line(x, y, x, y1);
line(x,y1,x2,y1);
}
-void Fl_PDF_Graphics_Driver::rect(int x, int y, int w, int h)
+void PDF_Graphics_Driver::rect(int x, int y, int w, int h)
{
PDF_rect(pdf, x, y+h, w, h);
PDF_stroke(pdf);
}
-void Fl_PDF_Graphics_Driver::rectf(int x, int y, int w, int h)
+void PDF_Graphics_Driver::rectf(int x, int y, int w, int h)
{
PDF_rect(pdf, x, y+h, w, h);
PDF_fill(pdf);
}
-void Fl_PDF_Graphics_Driver::draw(const char *str, int n, int x, int y)
+void PDF_Graphics_Driver::draw(const char *str, int n, int x, int y)
{
PDF_show_xy2(pdf, str, n, x, y);
}
-void Fl_PDF_Graphics_Driver::draw(int angle, const char* str, int n, int x, int y)
+void PDF_Graphics_Driver::draw(int angle, const char* str, int n, int x, int y)
{
PDF_save(pdf);
PDF_translate(pdf, x, y);
@@ -306,7 +308,7 @@ void Fl_PDF_Graphics_Driver::draw(int angle, const char* str, int n, int x, int
PDF_restore(pdf);
}
-void Fl_PDF_Graphics_Driver::font(int f, int s)
+void PDF_Graphics_Driver::font(int f, int s)
{
char *current_ps_font = prepare_ps_or_pdf_font(f);
pdf_font = PDF_load_font(pdf, current_ps_font, 0, encoding, "");
@@ -314,38 +316,38 @@ void Fl_PDF_Graphics_Driver::font(int f, int s)
if (in_page) PDF_setfont(pdf, pdf_font, s);
}
-void Fl_PDF_Graphics_Driver::color(Fl_Color c)
+void PDF_Graphics_Driver::color(Fl_Color c)
{
uchar red, green, blue;
Fl::get_color(c, red, green, blue);
color(red, green, blue);
}
-void Fl_PDF_Graphics_Driver::color(uchar red, uchar green, uchar blue)
+void PDF_Graphics_Driver::color(uchar red, uchar green, uchar blue)
{
float r, g, b;
r = red/255.; g = green/255.; b = blue/255.;
PDF_setcolor(pdf, "fillstroke", "rgb", r, g, b, 0);
}
-double Fl_PDF_Graphics_Driver::width(const char* str, int l)
+double PDF_Graphics_Driver::width(const char* str, int l)
{
return PDF_stringwidth2(pdf, str, l, pdf_font, size());
}
-int Fl_PDF_Graphics_Driver::height() {
+int PDF_Graphics_Driver::height() {
return size();
}
-int Fl_PDF_Graphics_Driver::descent() {
+int PDF_Graphics_Driver::descent() {
return (int)(-PDF_get_value(pdf, "descender", pdf_font) * size() + 0.5) + 1;
}
-void Fl_PDF_Graphics_Driver::draw(const char* str, int n, float fx, float fy) {
+void PDF_Graphics_Driver::draw(const char* str, int n, float fx, float fy) {
draw(str, n, (int)fx, (int)fy);
}
-void Fl_PDF_Graphics_Driver::push_clip(int x, int y, int w, int h)
+void PDF_Graphics_Driver::push_clip(int x, int y, int w, int h)
{
PDF_save(pdf);
PDF_moveto(pdf, x, y); PDF_lineto(pdf, x + w, y); PDF_lineto(pdf, x + w, y + h);
@@ -354,19 +356,19 @@ void Fl_PDF_Graphics_Driver::push_clip(int x, int y, int w, int h)
PDF_clip(pdf);
}
-void Fl_PDF_Graphics_Driver::pop_clip()
+void PDF_Graphics_Driver::pop_clip()
{
PDF_restore(pdf);
}
-void Fl_PDF_Graphics_Driver::draw_image(const uchar*, int, int, int, int, int, int) {}
-void Fl_PDF_Graphics_Driver::draw_image_mono(const uchar*, int, int, int, int, int, int) {}
-void Fl_PDF_Graphics_Driver::draw_image(void (*)(void*, int, int, int, uchar*), void*, int, int, int, int, int) {}
-void Fl_PDF_Graphics_Driver::draw_image_mono(void (*)(void*, int, int, int, uchar*), void*, int, int, int, int, int) {}
-void Fl_PDF_Graphics_Driver::draw(Fl_RGB_Image*, int, int, int, int, int, int) {}
-void Fl_PDF_Graphics_Driver::draw(Fl_Pixmap*, int, int, int, int, int, int) {}
-void Fl_PDF_Graphics_Driver::draw(Fl_Bitmap*, int, int, int, int, int, int) {}
-void Fl_PDF_Graphics_Driver::line_style(int style, int width, char *dashes) {}
-void Fl_PDF_Graphics_Driver::rtl_draw(const char*, int, int, int) {}
+void PDF_Graphics_Driver::draw_image(const uchar*, int, int, int, int, int, int) {}
+void PDF_Graphics_Driver::draw_image_mono(const uchar*, int, int, int, int, int, int) {}
+void PDF_Graphics_Driver::draw_image(void (*)(void*, int, int, int, uchar*), void*, int, int, int, int, int) {}
+void PDF_Graphics_Driver::draw_image_mono(void (*)(void*, int, int, int, uchar*), void*, int, int, int, int, int) {}
+void PDF_Graphics_Driver::draw(Fl_RGB_Image*, int, int, int, int, int, int) {}
+void PDF_Graphics_Driver::draw(Fl_Pixmap*, int, int, int, int, int, int) {}
+void PDF_Graphics_Driver::draw(Fl_Bitmap*, int, int, int, int, int, int) {}
+void PDF_Graphics_Driver::line_style(int style, int width, char *dashes) {}
+void PDF_Graphics_Driver::rtl_draw(const char*, int, int, int) {}
#endif // NO_PDF
=====================================
pdf_or_ps.h
=====================================
@@ -2,9 +2,6 @@
#define PDF_OR_PS_H
#include <FL/Fl_Paged_Device.H>
-#if 100*FL_MAJOR_VERSION + 10*FL_MINOR_VERSION + FL_PATCH_VERSION >= 140
-#include <FL/Fl_Graphics_Driver.H>
-#endif
#if defined(WIN32)
#include <windows.h>
@@ -12,26 +9,31 @@
#ifdef NO_PDF
#include <FL/Fl_PostScript.H>
-class Fl_PDF_or_PS_File_Device : public Fl_PostScript_File_Device {
+class PDF_or_PS_File_Device : public Fl_PostScript_File_Device {
FILE *file;
char *filename;
public:
- Fl_PDF_or_PS_File_Device() { file = NULL; }
+ PDF_or_PS_File_Device() { file = NULL; }
int begin_document(const char* fixedfilename, enum Fl_Paged_Device::Page_Format format=Fl_Paged_Device::A4,
enum Fl_Paged_Device::Page_Layout layout=Fl_Paged_Device::PORTRAIT);
int start_job(const char *defaultname, enum Fl_Paged_Device::Page_Format format=Fl_Paged_Device::A4,
enum Fl_Paged_Device::Page_Layout layout=Fl_Paged_Device::PORTRAIT);
- Fl_Graphics_Driver *driver() { return Fl_PostScript_File_Device::driver(); }
+ Fl_Graphics_Driver *driver() { return (Fl_Graphics_Driver*)Fl_PostScript_File_Device::driver(); }
const char *outfname() {return filename; }
- ~Fl_PDF_or_PS_File_Device();
+ ~PDF_or_PS_File_Device();
};
#else // NO_PDF
#include <pdflib.h>
#include <setjmp.h>
+#if 100*FL_MAJOR_VERSION + 10*FL_MINOR_VERSION + FL_PATCH_VERSION >= 140
+# include <FL/Fl_Graphics_Driver.H>
+#else
+# include <FL/Fl_Device.H>
+#endif
-class Fl_PDF_Graphics_Driver : public Fl_Graphics_Driver {
+class PDF_Graphics_Driver : public Fl_Graphics_Driver {
private:
int pdf_font;
const char *encoding;
@@ -39,7 +41,7 @@ private:
int tr_x, tr_y;
public:
PDF *pdf;
- Fl_PDF_Graphics_Driver();
+ PDF_Graphics_Driver();
void rect(int x, int y, int w, int h);
void rectf(int x, int y, int w, int h);
void line_style(int style, int width, char *dashes=0);
@@ -127,7 +129,7 @@ public:
const char *outfname() {return filename; }
~Fl_PDF_File_Device();
};
-typedef Fl_PDF_File_Device Fl_PDF_or_PS_File_Device;
+typedef Fl_PDF_File_Device PDF_or_PS_File_Device;
#endif // NO_PDF
#if defined(__APPLE__)
=====================================
seaview.html
=====================================
@@ -44,7 +44,7 @@ Molecular Biology and Evolution 27(2):221-224.
SEAVIEW and PHYLO_WIN: two graphic tools for sequence alignment and molecular phylogeny.</a>
Comput. Appl. Biosci., 12:543-548.
<p>
-Version 5.0.4
+Version 5.0.5
<p>Binaries and full source code available from <a href=http://doua.prabi.fr/software/seaview>http://doua.prabi.fr/software/seaview</a>
@@ -67,6 +67,7 @@ multiple sequence alignments using Clustal Omega.</a>
Phylogenies: Assessing the Performance of PhyML 3.0</a>. <i>Systematic Biology</i> 59(3):307-321.
<li>Felsenstein J. (2013) <a href=http://evolution.genetics.washington.edu/phylip.html>PHYLIP</a> version 3.696.
<li>Lemoine F., Domelevo Entfellner J.-B., Wilkinson E., Correia D., Dávila Felipe M., De Oliveira T. & Gascuel O. (2018) <a href=http://dx.doi.org/10.1038/s41586-018-0043-0>Renewing Felsenstein’s phylogenetic bootstrap in the era of big data.</a> <i>Nature</i> 556:452-456.
+<li>Comte N. et al. (2020) <a href=http://dx.doi.org/10.1093/bioinformatics/btaa615>Treerecs: an integrated phylogenetic tool, from sequences to reconciliations.</a> <i>Bioinformatics</i> in press.
</ul>
Seaview uses the <a href=http://www.fltk.org>FLTK</a> project for its user interface.
=====================================
svg.cxx
=====================================
@@ -9,20 +9,20 @@ extern void do_plot(FD_nj_plot *fd_nj_plot, int doing_print);
extern void frame_and_draw_unrooted(FD_unrooted *fd_unrooted);
extern "C" int trim_key(char *name); /* remove trailing spaces */
-const char *Fl_SVG_File_Surface::class_id = "Fl_SVG_File_Device";
+const char *SVG_File_Surface::class_id = "SVG_File_Device";
-Fl_SVG_File_Surface::~Fl_SVG_File_Surface() {
+SVG_File_Surface::~SVG_File_Surface() {
delete driver();
}
-void Fl_SVG_File_Surface::end() {
- Fl_SVG_Graphics_Driver *driver = (Fl_SVG_Graphics_Driver*)this->driver();
+void SVG_File_Surface::end() {
+ SVG_Graphics_Driver *driver = (SVG_Graphics_Driver*)this->driver();
fputs("</svg>\n", driver->file());
fflush(driver->file());
}
-Fl_SVG_Graphics_Driver::Fl_SVG_Graphics_Driver(FILE *f) {
+SVG_Graphics_Driver::SVG_Graphics_Driver(FILE *f) {
out_ = f;
width_ = 1;
linecap_ = "butt";
@@ -32,28 +32,28 @@ Fl_SVG_Graphics_Driver::Fl_SVG_Graphics_Driver(FILE *f) {
red_ = green_ = blue_ = 0;
}
-Fl_SVG_Graphics_Driver::~Fl_SVG_Graphics_Driver()
+SVG_Graphics_Driver::~SVG_Graphics_Driver()
{
}
-void Fl_SVG_Graphics_Driver::rect(int x, int y, int w, int h) {
+void SVG_Graphics_Driver::rect(int x, int y, int w, int h) {
fprintf(out_, "<rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" "
"fill=\"none\" stroke=\"rgb(%u,%u,%u)\" stroke-width=\"%d\"/>\n", x, y, w, h, red_, green_, blue_, width_);
}
-void Fl_SVG_Graphics_Driver::rectf(int x, int y, int w, int h) {
+void SVG_Graphics_Driver::rectf(int x, int y, int w, int h) {
fprintf(out_, "<rect x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" "
"fill=\"rgb(%u,%u,%u)\" />\n", x, y, w, h, red_, green_, blue_);
}
-void Fl_SVG_Graphics_Driver::line(int x1, int y1, int x2, int y2) {
+void SVG_Graphics_Driver::line(int x1, int y1, int x2, int y2) {
fprintf(out_,
"<line x1=\"%d\" y1=\"%d\" x2=\"%d\" y2=\"%d\" "
"style=\"stroke:rgb(%u,%u,%u);stroke-width:%d;stroke-linecap:%s\" />\n",
x1,y1,x2,y2, red_, green_, blue_, width_, linecap_);
}
-void Fl_SVG_Graphics_Driver::font_(int ft, int s) {
+void SVG_Graphics_Driver::font_(int ft, int s) {
Fl_Graphics_Driver::font(ft, s);
int famnum = ft/4;
if (famnum == 0) family_ = "Helvetica";
@@ -67,12 +67,12 @@ void Fl_SVG_Graphics_Driver::font_(int ft, int s) {
if (use_italic && famnum != 2) style_ = " font-style=\"oblique\"";
}
-void Fl_SVG_Graphics_Driver::font(int ft, int s) {
+void SVG_Graphics_Driver::font(int ft, int s) {
Fl_Display_Device::display_device()->driver()->font(ft, s);
font_(ft, s);
}
-void Fl_SVG_Graphics_Driver::line_style(int style, int width, char *dashes) {
+void SVG_Graphics_Driver::line_style(int style, int width, char *dashes) {
if (width == 0) width = 1;
width_ = width;
if (style & FL_CAP_SQUARE) linecap_ = "square";
@@ -80,7 +80,7 @@ void Fl_SVG_Graphics_Driver::line_style(int style, int width, char *dashes) {
else linecap_ = "butt";
}
-void Fl_SVG_Graphics_Driver::draw(const char *str, int n, int x, int y) {
+void SVG_Graphics_Driver::draw(const char *str, int n, int x, int y) {
// Caution: Internet Explorer ignores the xml:space="preserve" attribute
// work-around: replace all spaces by no-break space = U+00A0 = 0xC2-0xA0 (UTF-8) before sending to IE
fprintf(out_, "<text x=\"%d\" y=\"%d\" font-family=\"%s\"%s%s font-size=\"%d\" "
@@ -89,79 +89,79 @@ void Fl_SVG_Graphics_Driver::draw(const char *str, int n, int x, int y) {
}
-void Fl_SVG_Graphics_Driver::draw(const char* str, int n, float fx, float fy) {
+void SVG_Graphics_Driver::draw(const char* str, int n, float fx, float fy) {
return draw(str, n, (int)fx, (int)fy);
}
-void Fl_SVG_Graphics_Driver::draw(int angle, const char* str, int n, int x, int y) {
+void SVG_Graphics_Driver::draw(int angle, const char* str, int n, int x, int y) {
fprintf(out_, "<g transform=\"translate(%d,%d) rotate(%d)\">", x, y, -angle);
draw(str, n, 0, 0);
fputs("</g>\n", out_);
}
-void Fl_SVG_Graphics_Driver::rtl_draw(const char*, int, int, int) {}
+void SVG_Graphics_Driver::rtl_draw(const char*, int, int, int) {}
-void Fl_SVG_Graphics_Driver::color(Fl_Color c) {
+void SVG_Graphics_Driver::color(Fl_Color c) {
Fl_Graphics_Driver::color(c);
Fl::get_color(c, red_, green_, blue_);
}
-void Fl_SVG_Graphics_Driver::color(uchar r, uchar g, uchar b) {
+void SVG_Graphics_Driver::color(uchar r, uchar g, uchar b) {
red_ = r;
green_ = g;
blue_ = b;
}
-void Fl_SVG_Graphics_Driver::draw_image(const uchar*, int, int, int, int, int, int) {}
-void Fl_SVG_Graphics_Driver::draw_image_mono(const uchar*, int, int, int, int, int, int) {}
-void Fl_SVG_Graphics_Driver::draw_image(void (*)(void*, int, int, int, uchar*), void*, int, int, int, int, int) {}
-void Fl_SVG_Graphics_Driver::draw_image_mono(void (*)(void*, int, int, int, uchar*), void*, int, int, int, int, int) {}
-void Fl_SVG_Graphics_Driver::draw(Fl_RGB_Image*, int, int, int, int, int, int) {}
-void Fl_SVG_Graphics_Driver::draw(Fl_Pixmap*, int, int, int, int, int, int) {}
-void Fl_SVG_Graphics_Driver::draw(Fl_Bitmap*, int, int, int, int, int, int) {}
-double Fl_SVG_Graphics_Driver::width(const char* str, int l) {
+void SVG_Graphics_Driver::draw_image(const uchar*, int, int, int, int, int, int) {}
+void SVG_Graphics_Driver::draw_image_mono(const uchar*, int, int, int, int, int, int) {}
+void SVG_Graphics_Driver::draw_image(void (*)(void*, int, int, int, uchar*), void*, int, int, int, int, int) {}
+void SVG_Graphics_Driver::draw_image_mono(void (*)(void*, int, int, int, uchar*), void*, int, int, int, int, int) {}
+void SVG_Graphics_Driver::draw(Fl_RGB_Image*, int, int, int, int, int, int) {}
+void SVG_Graphics_Driver::draw(Fl_Pixmap*, int, int, int, int, int, int) {}
+void SVG_Graphics_Driver::draw(Fl_Bitmap*, int, int, int, int, int, int) {}
+double SVG_Graphics_Driver::width(const char* str, int l) {
return Fl_Display_Device::display_device()->driver()->width(str, l);
}
-int Fl_SVG_Graphics_Driver::height() {
+int SVG_Graphics_Driver::height() {
return Fl_Display_Device::display_device()->driver()->height();
}
-int Fl_SVG_Graphics_Driver::descent() {
+int SVG_Graphics_Driver::descent() {
return Fl_Display_Device::display_device()->driver()->descent();
}
#ifndef NO_PDF
-Fl_SVG_PDF_width_Graphics_Driver::Fl_SVG_PDF_width_Graphics_Driver(FILE *f) : Fl_SVG_Graphics_Driver(f), pdf_driver(new Fl_PDF_Graphics_Driver) {
+SVG_PDF_width_Graphics_Driver::SVG_PDF_width_Graphics_Driver(FILE *f) : SVG_Graphics_Driver(f), pdf_driver(new PDF_Graphics_Driver) {
pdf_driver->pdf = PDF_new();
PDF_begin_document(pdf_driver->pdf, "", 0, "");
PDF_begin_page_ext(pdf_driver->pdf, 100, 100, "");
}
-Fl_SVG_PDF_width_Graphics_Driver::~Fl_SVG_PDF_width_Graphics_Driver() {
+SVG_PDF_width_Graphics_Driver::~SVG_PDF_width_Graphics_Driver() {
PDF_end_page_ext(pdf_driver->pdf, "");
PDF_end_document(pdf_driver->pdf, "");
PDF_delete(pdf_driver->pdf);
delete pdf_driver;
}
-int Fl_SVG_PDF_width_Graphics_Driver::descent() {
+int SVG_PDF_width_Graphics_Driver::descent() {
return pdf_driver->descent();
}
-int Fl_SVG_PDF_width_Graphics_Driver::height() {
+int SVG_PDF_width_Graphics_Driver::height() {
return pdf_driver->height();
}
-double Fl_SVG_PDF_width_Graphics_Driver::width(const char* str, int l) {
+double SVG_PDF_width_Graphics_Driver::width(const char* str, int l) {
return pdf_driver->width(str, l);
}
-void Fl_SVG_PDF_width_Graphics_Driver::font(int ft, int s) {
+void SVG_PDF_width_Graphics_Driver::font(int ft, int s) {
font_(ft, s);
pdf_driver->font(ft, s);
}
#endif // NO_PDF
-Fl_SVG_File_Surface::Fl_SVG_File_Surface(int w, int h, FILE *f, bool use_pdf_width) : Fl_Surface_Device(NULL) {
+SVG_File_Surface::SVG_File_Surface(int w, int h, FILE *f, bool use_pdf_width) : Fl_Surface_Device(NULL) {
fprintf(f,
"<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n"
"<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \n"
@@ -171,14 +171,14 @@ Fl_SVG_File_Surface::Fl_SVG_File_Surface(int w, int h, FILE *f, bool use_pdf_wid
width_ = w; height_ = h;
#ifndef NO_PDF
if (use_pdf_width) {
- driver(new Fl_SVG_PDF_width_Graphics_Driver(f));
+ driver(new SVG_PDF_width_Graphics_Driver(f));
}
else
#endif
- driver(new Fl_SVG_Graphics_Driver(f));
+ driver(new SVG_Graphics_Driver(f));
}
-void svg_tree_save(FD_nj_plot *fd_nj_plot, Fl_SVG_File_Surface *svg)
+void svg_tree_save(FD_nj_plot *fd_nj_plot, SVG_File_Surface *svg)
{
svg->set_current();
fl_font(fd_nj_plot->font_family, fd_nj_plot->font_size);
@@ -213,7 +213,7 @@ void svg_tree_save(FD_nj_plot *fd_nj_plot, Fl_SVG_File_Surface *svg)
}
Fl_Display_Device::display_device()->set_current();
svg->end();
- fclose(((Fl_SVG_Graphics_Driver*)svg->driver())->file());
+ fclose(((SVG_Graphics_Driver*)svg->driver())->file());
delete svg;
}
@@ -241,7 +241,7 @@ void svg_tree_dialog_and_save(FD_nj_plot *fd_nj_plot)
width = fd_nj_plot->panel->w();
height = fd_nj_plot->panel->h() * fd_nj_plot->zoomvalue;
}
- svg_tree_save(fd_nj_plot, new Fl_SVG_File_Surface(width, height, out));
+ svg_tree_save(fd_nj_plot, new SVG_File_Surface(width, height, out));
}
=====================================
svg.h
=====================================
@@ -7,14 +7,14 @@
#include "pdf_or_ps.h"
#endif
-class Fl_SVG_Graphics_Driver : public Fl_Graphics_Driver {
+class SVG_Graphics_Driver : public Fl_Graphics_Driver {
FILE *out_;
int width_;
const char *linecap_;
uchar red_, green_, blue_;
public:
- Fl_SVG_Graphics_Driver(FILE*);
- ~Fl_SVG_Graphics_Driver();
+ SVG_Graphics_Driver(FILE*);
+ ~SVG_Graphics_Driver();
FILE* file() {return out_;}
protected:
const char *family_;
@@ -78,27 +78,27 @@ protected:
#endif
};
-class Fl_SVG_File_Surface : public Fl_Surface_Device {
+class SVG_File_Surface : public Fl_Surface_Device {
int width_, height_;
public:
static const char *class_id;
const char *class_name() {return class_id;};
- Fl_SVG_File_Surface(int, int, FILE*, bool use_pdf_width = false);
+ SVG_File_Surface(int, int, FILE*, bool use_pdf_width = false);
void end();
int width() { return width_; }
int height() { return height_; }
- ~Fl_SVG_File_Surface();
+ ~SVG_File_Surface();
};
#ifndef NO_PDF
-/* Fl_SVG_PDF_width_Graphics_Driver uses a PDF graphics driver only to compute string widths and heights,
+/* SVG_PDF_width_Graphics_Driver uses a PDF graphics driver only to compute string widths and heights,
to allow creation of SVG data without calling fl_open_display().
*/
-class Fl_SVG_PDF_width_Graphics_Driver : public Fl_SVG_Graphics_Driver {
- Fl_PDF_Graphics_Driver *pdf_driver;
+class SVG_PDF_width_Graphics_Driver : public SVG_Graphics_Driver {
+ PDF_Graphics_Driver *pdf_driver;
public:
- Fl_SVG_PDF_width_Graphics_Driver(FILE *f);
- ~Fl_SVG_PDF_width_Graphics_Driver();
+ SVG_PDF_width_Graphics_Driver(FILE *f);
+ ~SVG_PDF_width_Graphics_Driver();
int descent();
int height();
double width(const char* str, int l);
=====================================
treedraw.cxx
=====================================
@@ -148,7 +148,7 @@ extern void direct_help_callback(Fl_Widget *wgt, void *data);
extern void rooted_unrooted_callback(Fl_Widget *o, void *data);
extern void free_unrooted(FD_unrooted *data);
extern void unrooted_search(FD_unrooted *fd_unrooted, const char *select);
-extern void svg_tree_save(FD_nj_plot *fd_nj_plot, Fl_SVG_File_Surface *svg);
+extern void svg_tree_save(FD_nj_plot *fd_nj_plot, SVG_File_Surface *svg);
extern int debut_arbre(const char *tree, FD_unrooted *fd_unrooted);
extern int testbit(int *plist, int num);
extern void bit1(int *plist, int num);
@@ -3200,11 +3200,11 @@ void print_plot(FD_nj_plot *fd_nj_plot, bool to_ps_file, const char *directname)
if (fd_nj_plot->full) my_watch_cursor(fd_nj_plot->full->window());
Fl_Printer* myprinter;
if (to_ps_file) {
- myprinter = (Fl_Printer*)new Fl_PDF_or_PS_File_Device();
+ myprinter = (Fl_Printer*)new PDF_or_PS_File_Device();
if (directname) {
- error = ((Fl_PDF_or_PS_File_Device*)myprinter)->begin_document(directname, printout_pageformat, printout_layout);
+ error = ((PDF_or_PS_File_Device*)myprinter)->begin_document(directname, printout_pageformat, printout_layout);
}
- else error = ((Fl_PDF_or_PS_File_Device*)myprinter)->start_job(fd_nj_plot->tree_name, printout_pageformat, printout_layout);
+ else error = ((PDF_or_PS_File_Device*)myprinter)->start_job(fd_nj_plot->tree_name, printout_pageformat, printout_layout);
frompage = 1;
topage = fd_nj_plot->page_count;
}
@@ -3242,7 +3242,7 @@ void print_plot(FD_nj_plot *fd_nj_plot, bool to_ps_file, const char *directname)
page_y_offset = true_print_rect_y;
page_y_offset -= (frompage - 1) * (h - superpos);
for(page = frompage; page <= topage; page++) {
- if (to_ps_file) ((Fl_PDF_or_PS_File_Device*)myprinter)->start_page();
+ if (to_ps_file) ((PDF_or_PS_File_Device*)myprinter)->start_page();
else myprinter->start_page();
fl_push_clip(title_rect_x, title_rect_y, title_rect_w, title_height);
char *p = fd_nj_plot->tree_name;
@@ -3559,7 +3559,7 @@ void plotonly(int argc, char *argv[])
if (trim) fd_nj_plot->leaf_trimmer->process_to_labels();
// we must call runtree() so the tree is correctly oriented from its new root
// so we must have a graphics driver to compute string widths
- Fl_PDF_Graphics_Driver* pdf_driver = new Fl_PDF_Graphics_Driver;
+ PDF_Graphics_Driver* pdf_driver = new PDF_Graphics_Driver;
fl_graphics_driver = pdf_driver;
pdf_driver->pdf = PDF_new();
PDF_begin_document(pdf_driver->pdf, "", 0, "");
@@ -3597,7 +3597,7 @@ void plotonly(int argc, char *argv[])
if ((p = strrchr(pdfname, '.')) == NULL) p = pdfname + strlen(pdfname);
strcpy(p, use_svg ? ".svg" : ".pdf");
}
- Fl_SVG_File_Surface *svg;
+ SVG_File_Surface *svg;
if (use_svg) {
out = (strcmp(pdfname, "-") != 0 ? fl_fopen(pdfname, "w") : stdout);
if (!out) return;
@@ -3611,12 +3611,12 @@ void plotonly(int argc, char *argv[])
if (isarg(argc, argv, "-size")) {
sscanf(argname(argc, argv, "-size"), "%lfx%lf", &physx, &physy);
}
- svg = new Fl_SVG_File_Surface(physx, physy, out, true);
+ svg = new SVG_File_Surface(physx, physy, out, true);
svg->set_current();
}
else {
// we must call runtree() so we must have a graphics driver to compute string widths
- Fl_PDF_Graphics_Driver* pdf_driver = new Fl_PDF_Graphics_Driver;
+ PDF_Graphics_Driver* pdf_driver = new PDF_Graphics_Driver;
fl_graphics_driver = pdf_driver;
pdf_driver->pdf = PDF_new();
PDF_begin_document(pdf_driver->pdf, "", 0, "");
@@ -3630,7 +3630,7 @@ void plotonly(int argc, char *argv[])
}
runtree(fd_nj_plot);
if (!use_svg) {
- Fl_PDF_Graphics_Driver* pdf_driver = (Fl_PDF_Graphics_Driver*)fl_graphics_driver;
+ PDF_Graphics_Driver* pdf_driver = (PDF_Graphics_Driver*)fl_graphics_driver;
PDF_delete(pdf_driver->pdf);
delete pdf_driver;
}
=====================================
treerecs_draw.cxx
=====================================
@@ -4,6 +4,9 @@
#include <FL/fl_utf8.h>
+#if __APPLE_CC__
+#include <xlocale.h>
+#endif
#include <iostream>
#include <fstream>
#include <cstring>
=====================================
unrooted.cxx
=====================================
@@ -443,11 +443,11 @@ void print_unrooted(FD_unrooted *fd_unrooted, const char *name, bool to_ps_file,
old_x = fd_unrooted->x_offset;
old_y = fd_unrooted->y_offset;
if (to_ps_file) {
- myprinter = (Fl_Printer*)new Fl_PDF_or_PS_File_Device();
+ myprinter = (Fl_Printer*)new PDF_or_PS_File_Device();
if (directname)
- error = ((Fl_PDF_or_PS_File_Device*)myprinter)->begin_document(directname, printout_pageformat, printout_layout);
+ error = ((PDF_or_PS_File_Device*)myprinter)->begin_document(directname, printout_pageformat, printout_layout);
else
- error = ((Fl_PDF_or_PS_File_Device*)myprinter)->start_job(name, printout_pageformat, printout_layout) ;
+ error = ((PDF_or_PS_File_Device*)myprinter)->start_job(name, printout_pageformat, printout_layout) ;
if (error) return;
}
else {
@@ -460,7 +460,7 @@ void print_unrooted(FD_unrooted *fd_unrooted, const char *name, bool to_ps_file,
if (to_ps_file) ((Fl_PDF_File_Device*)myprinter)->surface_try(&jbuf);
if ( (!to_ps_file) || setjmp(*jbuf) == 0) { // replaces PDF_TRY
#endif
- if (to_ps_file) ((Fl_PDF_or_PS_File_Device*)myprinter)->start_page();
+ if (to_ps_file) ((PDF_or_PS_File_Device*)myprinter)->start_page();
else myprinter->start_page();
fd_unrooted->previous_w = fd_unrooted->previous_h = 0;
myprinter->printable_rect( &fd_unrooted->w, &fd_unrooted->h);
=====================================
use_mase_files.cxx
=====================================
@@ -1697,8 +1697,8 @@ int printout(SEA_VIEW *view, const char *filename,
}
widnames += 2;
if (use_pdf) {
- surface = new Fl_PDF_or_PS_File_Device();
- if (((Fl_PDF_or_PS_File_Device*)surface)->begin_document(filename, pageformat, layout)) {
+ surface = new PDF_or_PS_File_Device();
+ if (((PDF_or_PS_File_Device*)surface)->begin_document(filename, pageformat, layout)) {
delete surface;
return 0;
}
@@ -1707,7 +1707,7 @@ int printout(SEA_VIEW *view, const char *filename,
FILE *out = fl_fopen(filename, "w");
if (out == NULL) exit(1);
#ifndef NO_PDF
- Fl_SVG_PDF_width_Graphics_Driver *pdf_d = new Fl_SVG_PDF_width_Graphics_Driver(NULL);
+ SVG_PDF_width_Graphics_Driver *pdf_d = new SVG_PDF_width_Graphics_Driver(NULL);
pdf_d->font(FL_COURIER, fontsize);
char_width = pdf_d->width("X", 1);
delete pdf_d;
@@ -1721,7 +1721,7 @@ int printout(SEA_VIEW *view, const char *filename,
res_per_line = fin * block_size;
int nl = (max_seq_length + res_per_line - 1) /res_per_line;
int totl = nl * (view->tot_seqs + 2) + 2;
- surface = new Fl_SVG_File_Surface(svg_width, totl * fontsize, out, true);
+ surface = new SVG_File_Surface(svg_width, totl * fontsize, out, true);
surface->set_current();
fl_color(210,210,210); // draw grey background
fl_rectf(0,0,svg_width, totl * fontsize);
@@ -1732,16 +1732,16 @@ int printout(SEA_VIEW *view, const char *filename,
}
#ifndef NO_PDF
jmp_buf* jbuf;
- if (use_pdf) ((Fl_PDF_or_PS_File_Device*)surface)->surface_try(&jbuf);
+ if (use_pdf) ((PDF_or_PS_File_Device*)surface)->surface_try(&jbuf);
if ( (!use_pdf) || (setjmp(*jbuf) == 0)) {
#endif
if (use_pdf) {
surface->driver()->font(FL_COURIER, fontsize);
char_width = fl_width("X");
int pwidth, pheight;
- ((Fl_PDF_or_PS_File_Device*)surface)->printable_rect(&pwidth, &pheight);
+ ((PDF_or_PS_File_Device*)surface)->printable_rect(&pwidth, &pheight);
int l, r, t, b;
- ((Fl_PDF_or_PS_File_Device*)surface)->margins(&l, &t, &r, &b);
+ ((PDF_or_PS_File_Device*)surface)->margins(&l, &t, &r, &b);
margin -= l;
char_per_line = (int)((pwidth - 2*margin) / char_width + 0.5);
lines_per_page = (int)((pheight - 2*margin) / fontsize + 0.5);
@@ -1760,8 +1760,8 @@ int printout(SEA_VIEW *view, const char *filename,
time(&heure);
sprintf(oneline,"Alignment: %s", view->masename == NULL ? unnamed : PREPARE_LABEL(view->masename) );
if (use_pdf) {
- ((Fl_PDF_or_PS_File_Device*)surface)->start_page();
- ((Fl_PDF_or_PS_File_Device*)surface)->origin(0, fontsize);
+ ((PDF_or_PS_File_Device*)surface)->start_page();
+ ((PDF_or_PS_File_Device*)surface)->origin(0, fontsize);
fl_draw(oneline, margin, top_margin);
}
else if(!use_svg) {fputs(oneline, textfile); fputs("\n", textfile);}
@@ -1827,9 +1827,9 @@ int printout(SEA_VIEW *view, const char *filename,
nl = calc_vary_lines(vary_pos, k);
}
if( use_pdf && (!firstpage) && (curr_lines + view->tot_seqs + nl > lines_per_page)) {
- ((Fl_PDF_or_PS_File_Device*)surface)->end_page();
- ((Fl_PDF_or_PS_File_Device*)surface)->start_page();
- ((Fl_PDF_or_PS_File_Device*)surface)->origin(0, fontsize);
+ ((PDF_or_PS_File_Device*)surface)->end_page();
+ ((PDF_or_PS_File_Device*)surface)->start_page();
+ ((PDF_or_PS_File_Device*)surface)->origin(0, fontsize);
surface->driver()->font(FL_COURIER, fontsize);
curr_lines = 0;
}
@@ -1898,9 +1898,9 @@ int printout(SEA_VIEW *view, const char *filename,
oneline[k] = 0;
if(!view->allow_lower) majuscules(oneline + widnames);
if(use_pdf && (curr_lines >= lines_per_page)) {
- ((Fl_PDF_or_PS_File_Device*)surface)->end_page();
- ((Fl_PDF_or_PS_File_Device*)surface)->start_page();
- ((Fl_PDF_or_PS_File_Device*)surface)->origin(0, fontsize);
+ ((PDF_or_PS_File_Device*)surface)->end_page();
+ ((PDF_or_PS_File_Device*)surface)->start_page();
+ ((PDF_or_PS_File_Device*)surface)->origin(0, fontsize);
surface->driver()->font(FL_COURIER, fontsize);
curr_lines = 0;
}
@@ -1929,20 +1929,20 @@ int printout(SEA_VIEW *view, const char *filename,
if( ! vary_only ) current += res_per_line;
}
if(use_pdf) {
- ((Fl_PDF_or_PS_File_Device*)surface)->end_page();
- ((Fl_PDF_or_PS_File_Device*)surface)->end_job();
+ ((PDF_or_PS_File_Device*)surface)->end_page();
+ ((PDF_or_PS_File_Device*)surface)->end_job();
}
else if(use_svg) {
fl_color(FL_GRAY);
fl_line_style(0, 3);
- fl_rect(1,1, ((Fl_SVG_File_Surface*)surface)->width()-2, ((Fl_SVG_File_Surface*)surface)->height()-2);
- ((Fl_SVG_File_Surface*)surface)->end();
+ fl_rect(1,1, ((SVG_File_Surface*)surface)->width()-2, ((SVG_File_Surface*)surface)->height()-2);
+ ((SVG_File_Surface*)surface)->end();
}
else fclose(textfile);
#ifndef NO_PDF
} /* end of PDF_TRY */
- if (use_pdf && ((Fl_PDF_or_PS_File_Device*)surface)->surface_catch()) {
- ((Fl_PDF_or_PS_File_Device*)surface)->error_catch();
+ if (use_pdf && ((PDF_or_PS_File_Device*)surface)->surface_catch()) {
+ ((PDF_or_PS_File_Device*)surface)->error_catch();
}
#endif
if (use_pdf || use_svg) delete surface;
=====================================
xfmatpt.cxx
=====================================
@@ -808,7 +808,7 @@ int i;
char message[200];
int old_phys;
- Fl_PDF_or_PS_File_Device* surface = new Fl_PDF_or_PS_File_Device();
+ PDF_or_PS_File_Device* surface = new PDF_or_PS_File_Device();
if (surface->start_job(matpt->plotname, printout_pageformat)) return;
// we use bottom-up coords for PDF and PS output, it's rather tricky.
#ifndef NO_PDF
View it on GitLab: https://salsa.debian.org/med-team/seaview/-/compare/3b0c1998ab339b7a9255540c8c26fde203fd1af9...3c998a6ff7d20ec61ca710c73422ea423b4ad9b6
--
View it on GitLab: https://salsa.debian.org/med-team/seaview/-/compare/3b0c1998ab339b7a9255540c8c26fde203fd1af9...3c998a6ff7d20ec61ca710c73422ea423b4ad9b6
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220203/3f88c225/attachment-0001.htm>
More information about the debian-med-commit
mailing list