diff -up ./ICONS/calc.xpm.compat ./ICONS/calc.xpm --- ./ICONS/calc.xpm.compat 1998-02-09 23:37:23.000000000 +0300 +++ ./ICONS/calc.xpm 2016-02-15 15:56:08.210955485 +0300 @@ -1,5 +1,5 @@ /* XPM */ -static char *calc_xpm[] = { +static const char *calc_xpm[] = { /* columns rows colors chars-per-pixel */ "48 48 33 1", " c black", diff -up ./Main.fld.compat ./Main.fld --- ./Main.fld.compat 2000-07-14 15:50:23.000000000 +0400 +++ ./Main.fld 2016-02-15 15:56:08.210955485 +0300 @@ -1,17 +1,13 @@ # data file for the Fltk User Interface Designer (fluid) -version 2.00 +version 1.0303 header_name {.h} -code_name {.cxx} -gridx 5 -gridy 5 -snap 3 -decl {\#include "SciCalc.h"} {public +code_name {.cxx} +decl {\#include "SciCalc.h"} {public local } -Function {main(int ac,char *av)} {open selected return_type int +Function {main(int ac,char *av[])} {open return_type int } { - code {SciCalc *calc = new SciCalc(); - - calc->run(); - delete calc;} {} + code {SciCalc calc; +return calc.run(ac, av);} {selected + } } diff -up ./Makefile.compat ./Makefile --- ./Makefile.compat 2001-04-29 21:07:03.000000000 +0400 +++ ./Makefile 2016-02-15 16:10:51.638889510 +0300 @@ -4,40 +4,31 @@ LD = g++ TARGET = flcalc FLUID = fluid -PREFIX = -IFLAGS = -I/usr/X11/include -LFLAGS = -L/usr/X11R6/lib -L/usr/local/lib -CPPFLAGS = -O2 $(IFLAGS) $(DFLAGS) -Wall -CXXFLAGS = -O2 $(IFLAGS) $(DFLAGS) -Wall -CFLAGS = -O2 $(IFLAGS) $(DFLAGS) -Wall -LLIBS = -LIBS = -lfltk -lX11 -lm -OBJS = Main.o StaticText.o SciCalc.o +CXXFLAGS +=-Wall $(shell fltk-config --cxxflags) +LDFLAGS+=$(shell fltk-config --ldflags) +OBJS=Main.o StaticText.o SciCalc.o -all : $(TARGET) +all: $(TARGET) -.SUFFIXES: .cxx .hh .o .fld +%.cxx:%.fld + $(FLUID) -c $< -.fld.cxx: +%.h:%.fld $(FLUID) -c $< -.cxx.o : + +%.o:%.cxx $(OBJS:.o=.h) $(CXX) -c $< -o $(<:.cxx=.o) $(CXXFLAGS) -.c.o : - $(CC) -c $< -o $(<:.c=.o) $(CPPFLAGS) -$(TARGET) : $(OBJS) - $(LD) -o $(TARGET) $(OBJS) $(LFLAGS) $(LLIBS) $(LIBS) - strip $(TARGET) +$(TARGET):$(OBJS) + $(LD) -o $(TARGET) $(OBJS) $(LDFLAGS) + +.PHONY: clean backup clean: - -rm *.o - -rm $(TARGET) + rm -f *.o *.cxx *.h $(TARGET) backup: - tar cvf $(TARGET).tar $(PREFIX)*.cxx $(PREFIX)*.h *.fld ICONS Makefile - gzip $(TARGET).tar + tar -czf $(TARGET).tar.gz *.fld ICONS Makefile -protos: - cproto -e -q -E 0 -O /dev/null -o protos.h $(IFLAGS) $(PREFIX)*.cc $(PREFIX)*.c diff -up ./SciCalc.fld.compat ./SciCalc.fld --- ./SciCalc.fld.compat 2001-04-29 21:05:13.000000000 +0400 +++ ./SciCalc.fld 2016-02-15 15:56:08.211955485 +0300 @@ -1,21 +1,15 @@ # data file for the Fltk User Interface Designer (fluid) -version 1.0010 +version 1.0303 header_name {.h} -code_name {.cxx} -gridx 1 -gridy 1 -snap 1 -decl {\#include } {public +code_name {.cxx} +decl {\#include "StaticText.h"} {public local } -decl {\#include "StaticText.h"} {public +decl {\#include } {private local } -decl {\#include } {} - -decl {\#include "math.h"} {} - -decl {extern "C" char *strcat(const char *,char *);} {} +decl {\#include "math.h"} {private local +} Function {gammaln(double xx)} {open private return_type double } { @@ -47,36 +41,56 @@ Function {truncf(double x)} {private ret class SciCalc {open } { - decl {enum {MaxNumBrkts=10};} {} - decl {enum Operator {PLUS,MINUS,MULT,DIV,POW,INVPOW,EVAL};} {} - decl {enum mode {NONE=0,DOT=-1,NORM=-2,EXP=-3};} {} + decl {enum {MaxNumBrkts=10};} {private local + } + decl {enum Operator {PLUS,MINUS,MULT,DIV,POW,INVPOW,EVAL};} {private local + } + decl {enum mode {NONE=0,DOT=-1,NORM=-2,EXP=-3};} {private local + } declblock {/* members */} {after {/********/} } { - decl {double value[4*(MaxNumBrkts+1)]; /* The values on the stack */} {} - decl {int priority[6]; /* the priorities of each operator */} {} - decl {int oper[3*(MaxNumBrkts+1)]; /* the operators between them */} {} - decl {int top; /* the top of the stack */} {} - decl {int startbrkt[(MaxNumBrkts+1)]; /* the positions of the left brackets */} {} - decl {int currentbrkt; /* bracketing we are in */} {} - decl {double mem; /* The memory value */} {} + decl {double value[4*(MaxNumBrkts+1)]; /* The values on the stack */} {private local + } + decl {int priority[6]; /* the priorities of each operator */} {private local + } + decl {int oper[3*(MaxNumBrkts+1)]; /* the operators between them */} {private local + } + decl {int top; /* the top of the stack */} {private local + } + decl {int startbrkt[(MaxNumBrkts+1)]; /* the positions of the left brackets */} {private local + } + decl {int currentbrkt; /* bracketing we are in */} {private local + } + decl {double mem; /* The memory value */} {private local + } decl {int ready; /* Whether last number is ready. if "ready" is set, then typing another number - overwrites the current number. */} {} - decl {int dot; /* Whether the dot has been typed */} {} - decl {double diver; /* The divider when behind the dot */} {} - decl {int behind; /* Number of digits behind dot */} {} - decl {int inv; /* Whether inverse key is depressed */} {} - decl {int emode; /* Whether we are entering the exponent */} {} - decl {int exponent; /* the exponent value whilst entering exponent */} {} - decl {double mantissa; /* the mantissa value whilst entering exponent */} {} - decl {int base; /* the base we are working in (2,8,10 or 16) */} {} - decl {int drgmode; /* whether we are in deg, rad or grad mode */} {} + overwrites the current number. */} {private local + } + decl {int dot; /* Whether the dot has been typed */} {private local + } + decl {double diver; /* The divider when behind the dot */} {private local + } + decl {int behind; /* Number of digits behind dot */} {private local + } + decl {int inv; /* Whether inverse key is depressed */} {private local + } + decl {int emode; /* Whether we are entering the exponent */} {private local + } + decl {int exponent; /* the exponent value whilst entering exponent */} {private local + } + decl {double mantissa; /* the mantissa value whilst entering exponent */} {private local + } + decl {int base; /* the base we are working in (2,8,10 or 16) */} {private local + } + decl {int drgmode; /* whether we are in deg, rad or grad mode */} {private local + } } Function {SciCalc()} {open } { Fl_Window win { label flCalc open - private xywh {528 286 181 262} box UP_BOX visible + private xywh {361 248 180 260} type Double box UP_BOX visible } { Fl_Box leddisplay { callback {o->value("0 ");} @@ -97,7 +111,7 @@ class SciCalc {open private xywh {124 27 35 15} box ENGRAVED_BOX labelsize 9 align 16 class StaticText } - Fl_Group {} {open + Fl_Group {} { private xywh {46 44 93 22} box ENGRAVED_FRAME color 46 } { Fl_Button radio_2 { @@ -121,7 +135,7 @@ class SciCalc {open private xywh {114 48 21 15} type Radio labelsize 10 labelcolor 1 } } - Fl_Group {} {open + Fl_Group {} { private xywh {3 163 107 94} box ENGRAVED_BOX color 43 } { Fl_Button but_7 { @@ -245,7 +259,7 @@ box_bracket->redraw();} private xywh {147 253 6 7} box NO_BOX shortcut 0xff0d labelfont 1 labelsize 16 } Fl_Button but_eval_hidden2 { - callback {handle_operator(EVAL);} selected + callback {handle_operator(EVAL);} private xywh {157 263 6 7} box NO_BOX shortcut 0xff8d labelfont 1 labelsize 16 } Fl_Button but_sqrt { @@ -488,8 +502,7 @@ else } Fl_Button but_quit { label Exit - callback {win->hide(); -delete win;} + callback {win->hide();} selected private xywh {145 44 29 21} color 15 labeltype ENGRAVED_LABEL labelsize 12 labelcolor 33 } } @@ -505,11 +518,14 @@ delete win;} set_drgdisp(); set_display(0.0,NONE);} {} } - Function {~SciCalc()} {} {} - Function {run(int px=-1,int py=-1)} {open + Function {~SciCalc()} {open } { - code {win->show(); -Fl::run();} {} + code {delete win;} {} + } + Function {run(int ac,char *av[])} {open return_type int + } { + code {win->show(ac, av); +return Fl::run();} {} } Function {handle_number(double numb)} {private } { @@ -975,7 +991,6 @@ char digstr[2]; set_display(value[top],NORM); ready = 1; set_memdisp();} {} - code {printf("Hello, World!\\n");} {} } Function {to_drg(double angle)} {private return_type double } { @@ -997,8 +1012,7 @@ char digstr[2]; else return (angle);} {} } - Function {memexch()} {open - } { + Function {memexch()} {} { code {double temp; temp = mem; diff -up ./StaticText.fld.compat ./StaticText.fld --- ./StaticText.fld.compat 2000-07-17 15:25:47.000000000 +0400 +++ ./StaticText.fld 2016-02-15 15:56:08.211955485 +0300 @@ -1,24 +1,25 @@ # data file for the Fltk User Interface Designer (fluid) -version 2.00 +version 1.0303 header_name {.h} -code_name {.cxx} -gridx 5 -gridy 5 -snap 3 -decl {\#include } {public +code_name {.cxx} +decl {\#include } {public local } -decl {\#include } {} +decl {\#include } {private local +} -decl {\#include } {} +decl {\#include } {private local +} class StaticText {open : {public Fl_Widget} } { - decl {enum {MaxLength = 255};} {} - decl {char *str;} {} + decl {enum {MaxLength = 255};} {private local + } + decl {char *str;} {private local + } Function {StaticText(int xx,int yy,int ww,int hh) : Fl_Widget(xx,yy,ww,hh,0)} {open } { - code {str = 0;} {} + code {str = NULL;} {} } Function {~StaticText()} {open } {