xplot-1.19/ 40755 1750 1750 0 6730206300 11536 5ustar rhogeerhogeexplot-1.19/src/ 40755 1750 1750 0 6730205603 12332 5ustar rhogeerhogeexplot-1.19/src/plot.fd100644 1750 1750 33707 6151321523 13747 0ustar rhogeerhogeeMagic: 13000 Internal Form Definition File (do not change) Number of forms: 4 Unit of measure: FL_COORD_PIXEL =============== FORM =============== Name: plot Width: 390 Height: 360 Number of Objects: 28 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 390 360 boxtype: FL_FLAT_BOX colors: FL_DARKCYAN FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_TEXT type: NORMAL_TEXT box: 275 5 110 30 boxtype: FL_FLAT_BOX colors: FL_DARKCYAN FL_DOGERBLUE alignment: FL_ALIGN_CENTER|FL_ALIGN_INSIDE style: FL_TIMESITALIC_STYLE+FL_EMBOSSED_STYLE size: FL_HUGE_SIZE lcol: FL_BLUE label: XPlot ! shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: UP_BOX box: 275 90 110 75 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: UP_BOX box: 5 305 265 50 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BOX type: UP_BOX box: 5 5 265 295 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_XYPLOT type: NORMAL_XYPLOT box: 50 10 215 215 boxtype: FL_DOWN_BOX colors: FL_MCOL FL_BLACK alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: small_plot callback: argument: -------------------- class: FL_TEXT type: NORMAL_TEXT box: 295 95 70 15 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT|FL_ALIGN_INSIDE style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Line types shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 275 260 110 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Redraw now shortcut: ^L resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: redraw_plots argument: 0 -------------------- class: FL_CHECKBUTTON type: PUSH_BUTTON box: 275 240 110 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Auto-redraw shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: autoredraw_button callback: set_autoredraw argument: 0 -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 275 215 110 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Scale Y shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: guess_y argument: 0 -------------------- class: FL_CHECKBUTTON type: RADIO_BUTTON box: 275 115 110 15 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: solid or circles shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: linetype_guess callback: setlinetype argument: LINETYPE_GUESS -------------------- class: FL_CHECKBUTTON type: RADIO_BUTTON box: 275 125 110 15 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: solid shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: setlinetype argument: FL_NORMAL_XYPLOT -------------------- class: FL_CHECKBUTTON type: RADIO_BUTTON box: 275 135 105 15 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: solid with circles shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: setlinetype argument: FL_CIRCLE_XYPLOT -------------------- class: FL_CHECKBUTTON type: RADIO_BUTTON box: 275 145 110 15 boxtype: FL_NO_BOX colors: FL_COL1 FL_YELLOW alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: solid with squares shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: setlinetype argument: FL_SQUARE_XYPLOT -------------------- class: FL_SLIDER type: VERT_SLIDER box: 10 10 20 215 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: miny_slider callback: setrange argument: SET_MINY -------------------- class: FL_SLIDER type: VERT_SLIDER box: 30 10 20 215 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: maxy_slider callback: setrange argument: SET_MAXY -------------------- class: FL_SLIDER type: HOR_SLIDER box: 50 225 215 20 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: minx_slider callback: setrange argument: SET_MINX -------------------- class: FL_SLIDER type: HOR_SLIDER box: 50 245 215 20 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_TINY_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: maxx_slider callback: setrange argument: SET_MAXX -------------------- class: FL_INPUT type: FLOAT_INPUT box: 25 310 100 20 boxtype: FL_FLAT_BOX colors: FL_MCOL FL_COL1 alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: x shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: minx_input callback: setboundary argument: SET_MINX -------------------- class: FL_INPUT type: FLOAT_INPUT box: 165 310 100 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: to shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: maxx_input callback: setboundary argument: SET_MAXX -------------------- class: FL_INPUT type: FLOAT_INPUT box: 25 330 100 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: y shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: miny_input callback: setboundary argument: SET_MINY -------------------- class: FL_INPUT type: FLOAT_INPUT box: 165 330 100 20 boxtype: FL_FLAT_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: to shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: maxy_input callback: setboundary argument: SET_MAXY -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 275 65 110 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: (De) activate sets shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: activate_button callback: activate_sets argument: 0 -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 275 40 110 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Help / About.. shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: help_button callback: dohelp argument: 0 -------------------- class: FL_INPUT type: NORMAL_INPUT box: 50 270 215 25 boxtype: FL_DOWN_BOX colors: FL_COL1 FL_MCOL alignment: FL_ALIGN_LEFT style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Title shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: settitle argument: 0 -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 275 290 110 65 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: Dismiss (Esc) shortcut: ^[ resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: quit argument: 0 -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 275 170 110 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Static blowup shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: do_blowup argument: STATIC_BLOWUP -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 275 190 110 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Dynamic blowup shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: do_blowup argument: DYNAMIC_BLOWUP =============== FORM =============== Name: blowup Width: 380 Height: 330 Number of Objects: 3 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 380 330 boxtype: FL_FLAT_BOX colors: FL_WHITE FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_XYPLOT type: NORMAL_XYPLOT box: 0 0 380 330 boxtype: FL_FLAT_BOX colors: FL_WHITE FL_BLACK alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: blowup_plot callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 0 0 380 330 boxtype: FL_NO_BOX colors: FL_WHITE FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: blowup_quit callback: quitblowup argument: 0 =============== FORM =============== Name: activator Width: 140 Height: 205 Number of Objects: 3 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 140 205 boxtype: FL_FLAT_BOX colors: FL_DARKCYAN FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BROWSER type: SELECT_BROWSER box: 5 5 130 170 boxtype: FL_DOWN_BOX colors: FL_DARKCYAN FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_FIXED_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: activate_browser callback: setactive argument: 0 -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 25 180 110 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Dismiss shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: activator_done argument: 0 =============== FORM =============== Name: help Width: 435 Height: 470 Number of Objects: 7 -------------------- class: FL_BOX type: FLAT_BOX box: 0 0 435 470 boxtype: FL_FLAT_BOX colors: FL_DARKCYAN FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_BUTTON type: NORMAL_BUTTON box: 340 445 90 20 boxtype: FL_UP_BOX colors: FL_COL1 FL_COL1 alignment: FL_ALIGN_CENTER style: FL_NORMAL_STYLE size: FL_DEFAULT_SIZE lcol: FL_BLACK label: Done shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: help_done argument: 0 -------------------- class: FL_BROWSER type: SELECT_BROWSER box: 5 155 425 285 boxtype: FL_DOWN_BOX colors: FL_TOP_BCOL FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: help_browser callback: argument: 0 -------------------- class: FL_BROWSER type: SELECT_BROWSER box: 5 30 210 120 boxtype: FL_DOWN_BOX colors: FL_TOP_BCOL FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: help_contents_browser callback: argument: 0 -------------------- class: FL_BROWSER type: SELECT_BROWSER box: 220 30 210 120 boxtype: FL_DOWN_BOX colors: FL_TOP_BCOL FL_YELLOW alignment: FL_ALIGN_BOTTOM style: FL_NORMAL_STYLE size: FL_NORMAL_SIZE lcol: FL_BLACK label: shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: help_index_browser callback: argument: 0 -------------------- class: FL_TEXT type: NORMAL_TEXT box: 5 0 175 25 boxtype: FL_FLAT_BOX colors: FL_DARKCYAN FL_MCOL alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_MEDIUM_SIZE lcol: FL_CYAN label: Contents shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: -------------------- class: FL_TEXT type: NORMAL_TEXT box: 195 0 175 25 boxtype: FL_FLAT_BOX colors: FL_DARKCYAN FL_MCOL alignment: FL_ALIGN_CENTER style: FL_BOLD_STYLE size: FL_MEDIUM_SIZE lcol: FL_CYAN label: Index shortcut: resize: FL_RESIZE_ALL gravity: FL_NoGravity FL_NoGravity name: callback: argument: ============================== create_the_forms xplot-1.19/src/plot.h100644 1750 1750 2735 6151321523 13562 0ustar rhogeerhogee#ifndef FD_plot_h_ #define FD_plot_h_ /* Header file generated with fdesign. */ /**** Callback routines ****/ extern void redraw_plots(FL_OBJECT *, long); extern void set_autoredraw(FL_OBJECT *, long); extern void guess_y(FL_OBJECT *, long); extern void setlinetype(FL_OBJECT *, long); extern void setrange(FL_OBJECT *, long); extern void setboundary(FL_OBJECT *, long); extern void activate_sets(FL_OBJECT *, long); extern void dohelp(FL_OBJECT *, long); extern void settitle(FL_OBJECT *, long); extern void quit(FL_OBJECT *, long); extern void do_blowup(FL_OBJECT *, long); extern void quitblowup(FL_OBJECT *, long); extern void setactive(FL_OBJECT *, long); extern void activator_done(FL_OBJECT *, long); extern void help_done(FL_OBJECT *, long); /**** Forms and Objects ****/ extern FL_FORM *plot; extern FL_OBJECT *small_plot, *autoredraw_button, *linetype_guess, *miny_slider, *maxy_slider, *minx_slider, *maxx_slider, *minx_input, *maxx_input, *miny_input, *maxy_input, *activate_button, *help_button; extern FL_FORM *blowup; extern FL_OBJECT *blowup_plot, *blowup_quit; extern FL_FORM *activator; extern FL_OBJECT *activate_browser; extern FL_FORM *help; extern FL_OBJECT *help_browser, *help_contents_browser, *help_index_browser; /**** Creation Routine ****/ extern void create_the_forms(void); #endif /* FD_plot_h_ */ xplot-1.19/src/plot.c100644 1750 1750 17475 6706705153 13617 0ustar rhogeerhogee/* Form definition file generated with fdesign. */ #include #include #include "plot.h" FL_FORM *plot; FL_OBJECT *small_plot, *autoredraw_button, *linetype_guess, *miny_slider, *maxy_slider, *minx_slider, *maxx_slider, *minx_input, *maxx_input, *miny_input, *maxy_input, *activate_button, *help_button; void create_form_plot(void) { FL_OBJECT *obj; if (plot) return; plot = fl_bgn_form(FL_NO_BOX,390,360); obj = fl_add_box(FL_FLAT_BOX,0,0,390,360,""); fl_set_object_color(obj,FL_DARKCYAN,FL_COL1); obj = fl_add_text(FL_NORMAL_TEXT,275,5,110,30,"XPlot !"); fl_set_object_color(obj,FL_DARKCYAN,FL_DOGERBLUE); fl_set_object_lcol(obj,FL_BLUE); fl_set_object_lsize(obj,FL_HUGE_SIZE); fl_set_object_lalign(obj,FL_ALIGN_CENTER|FL_ALIGN_INSIDE); fl_set_object_lstyle(obj,FL_TIMESITALIC_STYLE+FL_EMBOSSED_STYLE); obj = fl_add_box(FL_UP_BOX,275,90,110,75,""); obj = fl_add_box(FL_UP_BOX,5,305,265,50,""); obj = fl_add_box(FL_UP_BOX,5,5,265,295,""); small_plot = obj = fl_add_xyplot(FL_NORMAL_XYPLOT,50,10,215,215,""); fl_set_object_boxtype(obj,FL_DOWN_BOX); fl_set_object_color(obj,FL_MCOL,FL_BLACK); obj = fl_add_text(FL_NORMAL_TEXT,295,95,70,15,"Line types"); fl_set_object_lsize(obj,FL_NORMAL_SIZE); fl_set_object_lalign(obj,FL_ALIGN_LEFT|FL_ALIGN_INSIDE); obj = fl_add_button(FL_NORMAL_BUTTON,275,260,110,20,"Redraw now"); fl_set_button_shortcut(obj,"^L",1); fl_set_object_callback(obj,redraw_plots,0); autoredraw_button = obj = fl_add_checkbutton(FL_PUSH_BUTTON,275,240,110,20,"Auto-redraw"); fl_set_object_boxtype(obj,FL_UP_BOX); fl_set_object_callback(obj,set_autoredraw,0); obj = fl_add_button(FL_NORMAL_BUTTON,275,215,110,20,"Scale Y"); fl_set_object_callback(obj,guess_y,0); linetype_guess = obj = fl_add_checkbutton(FL_RADIO_BUTTON,275,115,110,15,"solid or circles"); fl_set_object_callback(obj,setlinetype,LINETYPE_GUESS); obj = fl_add_checkbutton(FL_RADIO_BUTTON,275,125,110,15,"solid"); fl_set_object_callback(obj,setlinetype,FL_NORMAL_XYPLOT); obj = fl_add_checkbutton(FL_RADIO_BUTTON,275,135,105,15,"solid with circles"); fl_set_object_callback(obj,setlinetype,FL_CIRCLE_XYPLOT); obj = fl_add_checkbutton(FL_RADIO_BUTTON,275,145,110,15,"solid with squares"); fl_set_object_callback(obj,setlinetype,FL_SQUARE_XYPLOT); miny_slider = obj = fl_add_slider(FL_VERT_SLIDER,10,10,20,215,""); fl_set_object_callback(obj,setrange,SET_MINY); fl_set_slider_return(obj, FL_RETURN_CHANGED); maxy_slider = obj = fl_add_slider(FL_VERT_SLIDER,30,10,20,215,""); fl_set_object_callback(obj,setrange,SET_MAXY); fl_set_slider_return(obj, FL_RETURN_CHANGED); minx_slider = obj = fl_add_slider(FL_HOR_SLIDER,50,225,215,20,""); fl_set_object_callback(obj,setrange,SET_MINX); fl_set_slider_return(obj, FL_RETURN_CHANGED); maxx_slider = obj = fl_add_slider(FL_HOR_SLIDER,50,245,215,20,""); fl_set_object_callback(obj,setrange,SET_MAXX); fl_set_slider_return(obj, FL_RETURN_CHANGED); minx_input = obj = fl_add_input(FL_FLOAT_INPUT,25,310,100,20,"x"); fl_set_object_boxtype(obj,FL_FLAT_BOX); fl_set_object_color(obj,FL_MCOL,FL_COL1); fl_set_object_callback(obj,setboundary,SET_MINX); maxx_input = obj = fl_add_input(FL_FLOAT_INPUT,165,310,100,20,"to"); fl_set_object_boxtype(obj,FL_FLAT_BOX); fl_set_object_color(obj,FL_COL1,FL_COL1); fl_set_object_callback(obj,setboundary,SET_MAXX); miny_input = obj = fl_add_input(FL_FLOAT_INPUT,25,330,100,20,"y"); fl_set_object_boxtype(obj,FL_FLAT_BOX); fl_set_object_color(obj,FL_COL1,FL_COL1); fl_set_object_callback(obj,setboundary,SET_MINY); maxy_input = obj = fl_add_input(FL_FLOAT_INPUT,165,330,100,20,"to"); fl_set_object_boxtype(obj,FL_FLAT_BOX); fl_set_object_color(obj,FL_COL1,FL_COL1); fl_set_object_callback(obj,setboundary,SET_MAXY); activate_button = obj = fl_add_button(FL_NORMAL_BUTTON,275,65,110,20,"(De) activate sets"); fl_set_object_callback(obj,activate_sets,0); help_button = obj = fl_add_button(FL_NORMAL_BUTTON,275,40,110,20,"Help / About.."); fl_set_object_callback(obj,dohelp,0); obj = fl_add_input(FL_NORMAL_INPUT,50,270,215,25,"Title"); fl_set_object_callback(obj,settitle,0); obj = fl_add_button(FL_NORMAL_BUTTON,275,290,110,65,"Dismiss (Esc)"); fl_set_button_shortcut(obj,"^[",1); fl_set_object_lsize(obj,FL_NORMAL_SIZE); fl_set_object_callback(obj,quit,0); obj = fl_add_button(FL_NORMAL_BUTTON,275,170,110,20,"Static blowup"); fl_set_object_callback(obj,do_blowup,STATIC_BLOWUP); obj = fl_add_button(FL_NORMAL_BUTTON,275,190,110,20,"Dynamic blowup"); fl_set_object_callback(obj,do_blowup,DYNAMIC_BLOWUP); fl_end_form(); } /*---------------------------------------*/ FL_FORM *blowup; FL_OBJECT *blowup_plot, *blowup_quit; void create_form_blowup(void) { FL_OBJECT *obj; if (blowup) return; blowup = fl_bgn_form(FL_NO_BOX,380,330); obj = fl_add_box(FL_FLAT_BOX,0,0,380,330,""); fl_set_object_color(obj,FL_WHITE,FL_COL1); blowup_plot = obj = fl_add_xyplot(FL_NORMAL_XYPLOT,0,0,380,330,""); fl_set_object_color(obj,FL_WHITE,FL_BLACK); blowup_quit = obj = fl_add_button(FL_NORMAL_BUTTON,0,0,380,330,""); fl_set_object_boxtype(obj,FL_NO_BOX); fl_set_object_color(obj,FL_WHITE,FL_COL1); fl_set_object_callback(obj,quitblowup,0); fl_end_form(); } /*---------------------------------------*/ FL_FORM *activator; FL_OBJECT *activate_browser; void create_form_activator(void) { FL_OBJECT *obj; if (activator) return; activator = fl_bgn_form(FL_NO_BOX,140,205); obj = fl_add_box(FL_FLAT_BOX,0,0,140,205,""); fl_set_object_color(obj,FL_DARKCYAN,FL_COL1); activate_browser = obj = fl_add_browser(FL_SELECT_BROWSER,5,5,130,170,""); fl_set_object_color(obj,FL_DARKCYAN,FL_YELLOW); fl_set_object_lstyle(obj,FL_FIXED_STYLE); fl_set_object_callback(obj,setactive,0); obj = fl_add_button(FL_NORMAL_BUTTON,25,180,110,20,"Dismiss"); fl_set_object_callback(obj,activator_done,0); fl_end_form(); } /*---------------------------------------*/ FL_FORM *help; FL_OBJECT *help_browser, *help_contents_browser, *help_index_browser; void create_form_help(void) { FL_OBJECT *obj; if (help) return; help = fl_bgn_form(FL_NO_BOX,435,470); obj = fl_add_box(FL_FLAT_BOX,0,0,435,470,""); fl_set_object_color(obj,FL_DARKCYAN,FL_COL1); obj = fl_add_button(FL_NORMAL_BUTTON,340,445,90,20,"Done"); fl_set_object_callback(obj,help_done,0); help_browser = obj = fl_add_browser(FL_SELECT_BROWSER,5,155,425,285,""); fl_set_object_color(obj,FL_TOP_BCOL,FL_YELLOW); fl_set_object_lsize(obj,FL_NORMAL_SIZE); help_contents_browser = obj = fl_add_browser(FL_SELECT_BROWSER,5,30,210,120,""); fl_set_object_color(obj,FL_TOP_BCOL,FL_YELLOW); fl_set_object_lsize(obj,FL_NORMAL_SIZE); help_index_browser = obj = fl_add_browser(FL_SELECT_BROWSER,220,30,210,120,""); fl_set_object_color(obj,FL_TOP_BCOL,FL_YELLOW); fl_set_object_lsize(obj,FL_NORMAL_SIZE); obj = fl_add_text(FL_NORMAL_TEXT,5,0,175,25,"Contents"); fl_set_object_color(obj,FL_DARKCYAN,FL_MCOL); fl_set_object_lcol(obj,FL_CYAN); fl_set_object_lsize(obj,FL_MEDIUM_SIZE); fl_set_object_lalign(obj,FL_ALIGN_CENTER); fl_set_object_lstyle(obj,FL_BOLD_STYLE); obj = fl_add_text(FL_NORMAL_TEXT,195,0,175,25,"Index"); fl_set_object_color(obj,FL_DARKCYAN,FL_MCOL); fl_set_object_lcol(obj,FL_CYAN); fl_set_object_lsize(obj,FL_MEDIUM_SIZE); fl_set_object_lalign(obj,FL_ALIGN_CENTER); fl_set_object_lstyle(obj,FL_BOLD_STYLE); fl_end_form(); } /*---------------------------------------*/ void create_the_forms(void) { create_form_plot(); create_form_blowup(); create_form_activator(); create_form_help(); } xplot-1.19/src/xplot.c100644 1750 1750 14620 6641741530 13771 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" /* global vars */ Data *data; /* read datapoints */ int linetype = LINETYPE_GUESS, /* line type for plotting */ autoredraw = 1, /* auto-redraw all data? */ verbose, /* verbosity level */ ylimits_set, /* Y limits set via flag ? */ ndata; /* # of read series */ double minx = 9e99, maxx = -9e99, /* overall boundaries */ miny = 9e99, maxy = -9e99, curminx, curmaxx, /* current boundaries */ curminy, curmaxy; Blowup *blowups; /* array of blowup forms */ int nblowups; /* and # of blowup forms */ char formatstring [256], /* formatstring to read data */ titlestring [256]; /* title of plots if any */ void main (int argc, char **argv) { register int i; /* check for flags */ while (argc > 1 && *argv [1] == '-') { /* title of plot */ if (! strcmp (argv [1], "-title")) { if (argc < 3) error ("missing plot title after -title flag"); strcpy (titlestring, argv [2]); argc -= 2; argv += 2; } /* formatstring to read in data */ else if (! strcmp (argv [1], "-format")) { if (argc < 3) error ("missing format string after -format flag"); strcpy (formatstring, argv [2]); argc -= 2; argv += 2; } else if (! strcmp (argv [1], "-v")) { verbose++; argc--; argv++; } else if (! strcmp (argv [1], "-y")) { if (argc < 3) error ("missing y range after -y flag"); if (sscanf (argv [2], "%lf:%lf", &miny, &maxy) < 2) error ("bad y range after -y flag, use e.g. -y 0:6.28"); ylimits_set++; argc -= 2; argv += 2; } else error ("bad flag argument %s", argv [1]); } /* check for invocation without args */ if (argc == 1 && isatty (STDIN_FILENO)) usage (); /* demonize if compiled so, see the Makefile */ #ifdef DAEMONIZE if (argc > 1) { if ( (i = fork ()) < 0 ) warning ("fork failure: %s", strerror (errno)); else if (i) exit (0); } #endif /* fire up X forms */ fl_initialize (&argc, argv, "XPlot", 0, 0); create_form_plot (); create_form_activator (); create_form_help (); /* initial linestyle */ fl_set_button (linetype_guess, 1); /* initial redraw option */ fl_set_button (autoredraw_button, 1); /* check arguments, read files */ if (argc == 1) { if (isatty (STDIN_FILENO)) usage (); readfile (stdin, "<>"); } for (i = 1; i < argc; i++) { FILE *f; if (! (f = fopen (argv [i], "r")) ) error ("cannot open %s: %s", argv [i], strerror (errno)); readfile (f, argv [i]); fclose (f); } /* show overall X/Y ranges */ if (verbose) printf ("overall X: %g..%g\n" "overall Y: %g..%g\n", minx, maxx, miny, maxy); /* set current boundaries */ curminx = minx; curmaxx = maxx; curminy = miny; curmaxy = maxy; fl_set_slider_bounds (minx_slider, minx, maxx); fl_set_slider_bounds (maxx_slider, minx, maxx); /* Changed by: Peter S Galbraith Date: 28 December 1998 Why: I am reversing the direction of the y-sliders to make the interface more intuitive. When a user slide down the first slider from its top position, the top of the y-axis scale will change instead of the _bottom_ of the y-axis. Original code: fl_set_slider_bounds (miny_slider, miny, maxy); fl_set_slider_bounds (maxy_slider, miny, maxy); New code follows the comment: */ fl_set_slider_bounds (miny_slider, maxy, miny); fl_set_slider_bounds (maxy_slider, maxy, miny); /* show main form and draw */ showform (plot, FL_PLACE_SIZE, "XPlot Control"); boundaries (); /* forms loop */ fl_do_forms (); /* not reached */ } xplot-1.19/src/xplot.h100644 1750 1750 11326 6707144052 13775 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include #include #include #include #include #include #include #include #include "plot.h" /* macro section */ #define LINETYPE_GUESS -1 /* guess line types ? */ #define GUESS_X 0 /* guess X range ? */ #define GUESS_Y 1 /* guess Y range ? */ #define SET_MINX 0 /* set boundary lowest X */ #define SET_MAXX 1 /* highest X */ #define SET_MINY 2 /* lowest Y */ #define SET_MAXY 3 /* highest Y */ #define VERYTINY 0.01 /* smallest resolution */ #define HIDDEN_BLOWUP 0 /* removed from screen */ #define STATIC_BLOWUP 1 /* redrawing: does it */ #define DYNAMIC_BLOWUP 2 /* or doesn't it change */ #ifndef HELPFILE # define HELPFILE "/usr/local/share/xplot/xplot.help" /* file with help text */ #endif /* representation of data */ typedef struct { int npoints; /* # of x/y points */ float *x; /* vector of x */ float *y; /* vector of y */ int color; /* color code */ int active; /* on screen? */ } Data; /* blowup representation */ typedef struct { FL_FORM *form; /* the form */ FL_OBJECT *ob; /* the xy_plot object */ int type; /* type: dynamic or static */ } Blowup; /* global variables */ extern Data *data; extern int verbose, linetype, ndata, autoredraw, ylimits_set; extern double minx, maxx, miny, maxy, curminx, curmaxx, curminy, curmaxy; extern char formatstring [], titlestring []; extern Blowup *blowups; extern int nblowups; /* function prototypes */ extern void boundaries (void); extern void checkranges (void); extern void create_form_activator (void); extern void create_form_blowup (void); extern void create_form_help (void); extern void create_form_plot (void); extern void error (char *fmt, ...); extern char *fgetline (char *buf, int max, FILE *f); extern void hideform (FL_FORM *form); extern void usage (void); extern void redraw (FL_OBJECT *xyplot, FL_FORM *form); extern void readfile (FILE *f, char *name); extern void setinputstrings (void); extern void showform (FL_FORM *form, int placing, char *title); extern void warning (char *fmt, ...); xplot-1.19/src/usage.c100644 1750 1750 6417 6077442576 13727 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void usage () { printf ( "\n" "X Datafile Plotter V" VER "\n" "Copyright (c) ICCE / Karel Kubat 1995. All rights reserved.\n" "Another MegaHard production!\n" "\n" "Usage: xplot [flags] datafile(s) (plots the files)\n" " or: command | xplot [flags] (plots stdin)\n" "Each datastream must be either a one-dimensional series of Y-values to\n" "plot, separated by newlines, or a two-dimensional series of X/Y values,\n" "the pairs separated by newlines and the values separated by whitespace.\n" "#-style comment lines are allowed.\n" "Flags may be:\n" " -v : increases verbosity\n" " -title 'titlestring' : defines title for the plot\n" " -format 'formatstring' : overrides C-format string to read in data\n" " use %%f specifiers to read in floats\n" " -y `yrange' : specifies range of y axis, `yrange' must be\n" " in the format number:number (e.g., 0:13)\n" "\n"); exit (1); } xplot-1.19/src/readfile.c100644 1750 1750 12227 6077443005 14376 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" static int /* plotting colors */ plotcolor [] = { FL_GREEN, FL_BLUE, FL_RED, FL_MAGENTA, FL_TOMATO, FL_INDIANRED, FL_SLATEBLUE, FL_DARKGOLD, FL_DARKTOMATO, FL_DARKORANGE, FL_DEEPPINK, FL_CHARTREUSE, FL_DARKVIOLET, FL_DOGERBLUE, }; void readfile (FILE *f, char *name) { Data *dest; /* tmp pointer into storage of data */ char buf [100]; /* file input buf */ register int twodim = 0, /* 1- or 2-dim file? */ active = 1, /* initially active? */ res; /* conversion result */ float curx, cury; /* X/Y values to enter */ /* make sure we have a valid (default) formatstring */ if (! formatstring [0]) strcpy (formatstring, "%f %f "); /* make memory for data */ if (! (data = (Data *) realloc (data, (ndata + 1) * sizeof (Data))) ) error ("out of memory"); dest = data + ndata; if (verbose) printf ("%s: ", name); if (++ndata > FL_MAX_XYPLOTOVERLAY) { warning ("only up to %d overlays supported in one plot at one time", FL_MAX_XYPLOTOVERLAY); active = 0; } dest->npoints = 0; dest->x = 0; dest->y = 0; dest->color = plotcolor [ndata % (sizeof (plotcolor) / sizeof (int))]; dest->active = active; /* let's see if this is a one- or twodim stream */ if (! fgetline (buf, 99, f)) error ("empty datastream"); res = sscanf (buf, formatstring, &curx, &cury); if (res == 2) twodim = 1; else if (res < 1) error ("invalid data format"); /* now enter all data */ if (! twodim) curx = 0; while (1) { /* create room for x/y */ if (! (dest->x = (float *) realloc (dest->x, (dest->npoints + 1) * sizeof (float))) || ! (dest->y = (float *) realloc (dest->y, (dest->npoints + 1) * sizeof (float))) ) error ("out of memory"); /* get the values */ if (twodim) { if (sscanf (buf, "%f %f ", &curx, &cury) < 2) error ("invalid data for 2-dim stream"); } else if (sscanf (buf, "%f ", &cury) < 1) error ("invalid data for 1-dim stream"); dest->x [dest->npoints] = curx; dest->y [dest->npoints] = cury; dest->npoints++; /* determine overall min/max values */ if (minx > curx) minx = curx; if (maxx < curx) maxx = curx; if (! ylimits_set) { if (miny > cury) miny = cury; if (maxy < cury) maxy = cury; } /* adjust X for one-dimensional series */ if (! twodim) curx += 1.0; /* next line */ if (! fgetline (buf, 99, f)) break; } /* add the file info to the activator browser */ sprintf (buf, "@C%d[+] %s", dest->color, name); fl_add_browser_line (activate_browser, buf); /* show # of points */ if (verbose) printf ("%d points\n", data [ndata - 1].npoints); } xplot-1.19/src/error.c100644 1750 1750 4657 6030475205 13740 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void error (char *fmt, ...) { va_list args; printf ("xplot: "); va_start (args, fmt); vprintf (fmt, args); putchar ('\n'); exit (1); } xplot-1.19/src/fgetline.c100644 1750 1750 6507 6637737412 14416 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" char *fgetline (char *buf, int max, FILE *f) { register char *cp; while (1) { fgets (buf, max, f); /* read a line */ if (feof (f)) return (NULL); /* Peter S Galbraith Dec 22 1998 XPlot failed to read in lines that began with a minus sign or a decimal point (A better fix would be to use a regular expression library). I add those characters here: */ /* skip lines that don't */ if ( (buf [0] == '\n') || /* look right */ (buf [0] != ' ' && buf [0] != '.' && buf [0] != '-' && ! isdigit (buf [0])) ) continue; /* Peter S Galbraith Dec 22 1998 ...and again here: */ for (cp = buf; *cp; cp++) /* if a digit or . in buf */ if (isdigit (*cp) || *cp == '.' || *cp == '-') /* return it */ return (buf); } /* not reached */ } xplot-1.19/src/Makefile100644 1750 1750 10051 6726764117 14123 0ustar rhogeerhogee############################################################################ # # Makefile for XPLOT program. # # The directory that xplot goes to on a "make install" PREFIX = /usr/local BINDIR = $(PREFIX)/bin MANDIR = $(PREFIX)/man/man1 # The filename of the helpfile. Used for copying on a "make install" and # as the filename in the sources. HELPDIR = $(PREFIX)/share/xplot HELPFILE = $(HELPDIR)/xplot.help # If you want xplot to auto-daemonize (go to background) when started, # uncomment the following DAEMONIZE = -DDAEMONIZE # Two variables to find the forms library and headers. # You will need the library and header to compile XPlot. You can ftp them # from ftp://bloch.phys.uwm.edu/pub/xforms or # ftp://ftp.cs.ruu.nl/pub/XFORMS. # # The directory that you keep forms.h, if it's not a system-include directory. # Prefix this name with -I, e.g.: # FORM_INCLUDE = -I/usr/local/X11/include # The directory where you keep libforms.a, if it's a non-system library # dir. Prefix this name with -L, e.g.: FORM_LIB = -L/usr/X11R6/lib # Next, we need the libfli.a library and fli.h, the ICCE Add-ons for # XForms. The sources are incuded here, and built here. For your own # projects, You can ftp it from ftp://ftp.icce.rug.nl/pub/unix. # # The directory where you have the ICCE XForms add-ons include file, e.g.: # FLI_INCLUDE = -I/usr/local/X11/include FLI_INCLUDE = -I../libfli/lib # The directory where you have the ICCE XForms add-ons, e.g.: # FLI_LIB = -L/usr/local/X11/lib FLI_LIB = -L../libfli/lib # The rest should be OK, no need to change. ############################################################################# # current version, my task to change that VER = 1.19 # C flag for debugging: -g gives gdb info, but "install -s" will strip when # "make install" is done CDEBUG = -g # Linkage flags, default none LDEBUG= # object files we need OBJ = error.o fgetline.o readfile.o usage.o xplot.o forms.o setrange.o \ setlinetype.o checkranges.o activatordone.o redrawplots.o \ guessy.o redraw.o quit.o doblowup.o quitblowup.o setautoredraw.o \ setboundary.o setinputstrings.o boundaries.o activatesets.o \ setactive.o dohelp.o helpdone.o settitle.o warning.o showform.o # compilation flags CFLAGS = -O2 $(CDEBUG) -Wall \ -DVER=\"$(VER)\" \ -DHELPFILE=\"$(HELPFILE)\" \ $(FORM_INCLUDE) $(FLI_INCLUDE) \ $(DAEMONIZE) # entry point foobar: @echo 'Make what? Select:' @echo 'make xplot: make program in this dir, non-debug version' @echo 'make debug: make program in this dir, debug version' @echo 'make tests: make in this dir and run a couple of tests' @echo 'make clean: clean up stale files' @echo 'make install: make program and install it to $(BINDIR)' @echo 'make dist: make distribution, only for me (karel)' exit 1 ../libfli/lib/libfli.a: (cd ../libfli/lib/; ./cbuild) # executable xplot: $(OBJ) ../libfli/lib/libfli.a $(CC) -o xplot $(OBJ) $(FORM_LIB) $(FLI_LIB) \ -lforms -lfli -lX11 -lm $(LDEBUG) debug: make CDEBUG=-g LDEBUG=-static DAEMONIZE='' xplot # tests to run tests: xplot @echo Sine function.. test/sine | ./xplot @echo 'Hit ENTER..' @read @echo Nontabulated line.. test/nontab | ./xplot @echo 'Hit ENTER..' @read @echo Now for both.. test/sine > /tmp/sine.data.out test/nontab > /tmp/nontab.data.out ./xplot /tmp/sine.data.out /tmp/nontab.data.out @echo 'Hit ENTER..' @read rm -f /tmp/sine.data.out /tmp/nontab.data.out @echo Now lots of sines.. test/lotsofsines ./xplot /tmp/lotsofsines.data.out.* @echo 'Hit ENTER..' @read @echo 'Test series done!' rm -f /tmp/lotsofsines.data.out.* # installation install: $(BINDIR)/xplot $(HELPFILE) $(BINDIR)/xplot: xplot install -s -m 755 xplot $(BINDIR) install -m 644 xplot.1 $(MANDIR) $(HELPFILE): ../xplot.help install -d $(HELPDIR) install -m 644 ../xplot.help $(HELPFILE) # cleaning up clean: rm -f $(OBJ) xplot ../libfli/lib/libfli.a # distribution dist: clean ./.makedist $(VER) # extra deps plot.c: plot.fd fdesign -altformat -convert plot.fd forms.o: forms.c plot.c usage.o: usage.c Makefile dohelp.o: dohelp.c Makefile xplot.o: xplot.c Makefile xplot-1.19/src/redraw.c100644 1750 1750 7770 6077422700 14075 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void redraw (FL_OBJECT *plobj, FL_FORM *plform) { register int points, p, i; float dummy = 0; static char oldtitlestring [256]; fl_freeze_form (plform); /* don't plot now */ for (i = 0; i < ndata; i++) /* delete all datasets */ fl_delete_xyplot_overlay (plobj, i + 1); fl_set_xyplot_xbounds (plobj, curminx, curmaxx); /* new boundaries */ fl_set_xyplot_ybounds (plobj, curminy, curmaxy); /* plot dummy as `main' function */ fl_set_xyplot_data (plobj, &dummy, &dummy, 1, "", "", ""); for (i = 0; i < ndata; i++) { if (! data [i].active) /* add dummy for nonact */ { fl_add_xyplot_overlay (plobj, i + 1, &dummy, &dummy, 1, data [i].color); continue; } /* add active dataset */ fl_add_xyplot_overlay (plobj, i + 1, data [i].x, data [i].y, data [i].npoints, data [i].color); if (linetype == LINETYPE_GUESS) /* determine linestyle */ { points = 0; for (p = 0; p < data [i].npoints; p++) { if (data [i].x [p] >= curminx && data [i].x [p] <= curmaxx ) { points++; if (points > 20) { fl_set_xyplot_overlay_type (plobj, i + 1, FL_NORMAL_XYPLOT); break; } } } if (points < 20) fl_set_xyplot_overlay_type (plobj, i + 1, FL_CIRCLE_XYPLOT); } else fl_set_xyplot_overlay_type (plobj, i + 1, linetype); } /* add title if any */ if (oldtitlestring [0]) fl_delete_xyplot_text (plobj, oldtitlestring); if (titlestring [0]) fl_add_xyplot_text (plobj, (curminx + curmaxx) / 2, curmaxy, titlestring, FL_ALIGN_BOTTOM, FL_BLACK); strcpy (oldtitlestring, titlestring); fl_unfreeze_form (plform); /* plot it now */ } xplot-1.19/src/test/ 40755 1750 1750 0 6636001171 13310 5ustar rhogeerhogeexplot-1.19/src/test/sine100755 1750 1750 152 6025505511 14246 0ustar rhogeerhogee#!/bin/sh awk 'BEGIN { for (x = 0; x <= 6.3; x += 0.1) printf ("%g %g\n", x, sin (x)); }' xplot-1.19/src/test/square100755 1750 1750 123 6025506704 14613 0ustar rhogeerhogee#!/bin/sh awk 'BEGIN { print 1, 1 print 1, -1 print -1, 1 print -1, -1 }' xplot-1.19/src/test/lotsofsines100755 1750 1750 321 6025570652 15666 0ustar rhogeerhogee#!/bin/sh awk 'BEGIN { for (mult = 1; mult <= 10; mult++) { outf = "/tmp/lotsofsines.data.out." mult; for (x = 0; x <= 6.3; x += 0.1) printf ("%g %g\n", x, sin(x * mult / 10)) > outf; } }' xplot-1.19/src/test/nontab100755 1750 1750 223 6025522004 14564 0ustar rhogeerhogee#!/bin/sh awk 'BEGIN { for (d = 6.3; d >= 0; d -= 0.08) # for (d = 0; d <= 6.3; d += 1) printf ("%g %g\n", d, d * 2 / 6.3 - 1); }' xplot-1.19/src/warning.c100644 1750 1750 4642 6032732113 14242 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void warning (char *fmt, ...) { va_list args; printf ("xplot: "); va_start (args, fmt); vprintf (fmt, args); putchar ('\n'); } xplot-1.19/src/setrange.c100644 1750 1750 5166 6025513367 14421 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void setrange (FL_OBJECT *ob, long d) { switch (d) { case SET_MINX: curminx = fl_get_slider_value (ob); break; case SET_MAXX: curmaxx = fl_get_slider_value (ob); break; case SET_MINY: curminy = fl_get_slider_value (ob); break; case SET_MAXY: curmaxy = fl_get_slider_value (ob); break; } boundaries (); } xplot-1.19/src/guessy.c100644 1750 1750 5676 6032262314 14125 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void guess_y (FL_OBJECT *ob, long d) { register int i, p; float thisx, thisy; curminy = 9E99; /* reset min/max values */ curmaxy = -9E99; for (i = 0; i < ndata; i++) /* check all datasets */ { if (! (data [i].active)) /* skip deactivated sets */ continue; for (p = 0; p < data [i].npoints; p++) { thisx = data [i].x [p]; /* check x/y points */ thisy = data [i].y [p]; if (thisx >= curminx && thisx <= curmaxx) { if (curminy > thisy) /* set min/max values */ curminy = thisy; /* if necessary */ if (curmaxy < thisy) curmaxy = thisy; } } } boundaries (); } xplot-1.19/src/boundaries.c100644 1750 1750 5104 6077422033 14730 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void boundaries () { checkranges (); setinputstrings (); fl_set_slider_value (minx_slider, curminx); fl_set_slider_value (maxx_slider, curmaxx); fl_set_slider_value (miny_slider, curminy); fl_set_slider_value (maxy_slider, curmaxy); if (autoredraw) redraw_plots (NULL, 0); } xplot-1.19/src/setlinetype.c100644 1750 1750 4545 6025513367 15156 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void setlinetype (FL_OBJECT *ob, long val) { linetype = (int) val; boundaries (); } xplot-1.19/src/forms.c100644 1750 1750 4522 6025241520 13717 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ /* wrapper for fdesign's output file, needs xplot.h */ #include "xplot.h" #include "plot.c" xplot-1.19/src/activatesets.c100644 1750 1750 4752 6036221606 15302 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void activate_sets (FL_OBJECT *ob, long d) { /* make button no longer active */ fl_deactivate_object (ob); /* show the form */ fl_show_form (activator, FL_PLACE_FREE, FL_FULLBORDER, "XPlot Activator"); } xplot-1.19/src/activatordone.c100644 1750 1750 4603 6036222251 15435 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void activator_done (FL_OBJECT *ob, long data) { fl_hide_form (activator); fl_activate_object (activate_button); } xplot-1.19/src/doblowup.c100644 1750 1750 6554 6077423564 14454 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void do_blowup (FL_OBJECT *ob, long d) { char title [80]; /* create the blowup form */ create_form_blowup (); /* blowup is now the form */ /* blowup_quit is now quitbutton */ /* blowup_plot is now xyplot */ /* add the form to our list */ if (! (blowups = (Blowup *) realloc (blowups, (nblowups + 1) * sizeof (Blowup))) ) error ("out of memory"); blowups [nblowups].form = blowup; blowups [nblowups].ob = blowup_plot; blowups [nblowups].type = (int) d; /* modify the callback */ fl_set_object_callback (blowup_quit, quitblowup, (long) nblowups); /* draw the functions */ redraw (blowup_plot, blowup); if (titlestring [0]) /* overall plotting title? */ showform (blowup, FL_PLACE_FREE, titlestring); else /* our own title */ { sprintf (title, "XPlot blowup %d", nblowups); showform (blowup, FL_PLACE_FREE, title); } nblowups++; /* increase # of blowups counter */ blowup = NULL; /* allow re-creation the next time */ } xplot-1.19/src/setactive.c100644 1750 1750 5701 6077417230 14572 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void setactive (FL_OBJECT *ob, long d) { int choice = fl_get_browser (ob); /* selected line */ char const *line = fl_get_browser_line (ob, choice); /* selected text */ int activate_set; /* activate or deact? */ char *cp, buf [100]; /* toggle the + or - in the line */ strcpy (buf, line); for (cp = buf; *cp; cp++) if (*cp == '[') { cp++; break; } activate_set = *cp == '-'; *cp = activate_set ? '+' : '-'; /* tag data */ data [choice - 1].active = activate_set; /* replace browser info */ fl_replace_browser_line (ob, choice, buf); /* redraw if needed, check boundaries too */ boundaries (); } xplot-1.19/src/quit.c100644 1750 1750 4503 6036215340 13555 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void quit (FL_OBJECT *ob, long d) { hideform (plot); } xplot-1.19/src/dohelp.c100644 1750 1750 5613 6026022730 14047 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void dohelp (FL_OBJECT *ob, long d) { static char *notloaded [] = { "Sorry, help unavailable.", "The help file was not found or could not", "be loaded.", }; register int i; /* deactivate help button */ fl_deactivate_object (ob); /* load browser */ if (fli_load_help_browser (help, help_browser, help_contents_browser, help_index_browser, HELPFILE)) for (i = 0; i < (sizeof (notloaded) / sizeof (char *)); i++) fl_add_browser_line (help_browser, notloaded [i]); /* show the form */ fl_show_form (help, FL_PLACE_SIZE | FL_PLACE_MOUSE, FL_FULLBORDER, "XPlot Info"); } xplot-1.19/src/quitblowup.c100644 1750 1750 5430 6077422700 15013 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void quitblowup (FL_OBJECT *ob, long d) { int index = (int) d; /* index in blowups */ /* array */ if (blowups [index].type == HIDDEN_BLOWUP) /* don't process when */ return; /* already offscreen */ hideform (blowups [index].form); /* remove from screen */ fl_free_form (blowups [index].form); blowups [index].type = HIDDEN_BLOWUP; /* now inactive */ } xplot-1.19/src/setautoredraw.c100644 1750 1750 5007 6025513367 15474 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void set_autoredraw (FL_OBJECT *ob, long data) { /* toggle autoredraw option */ autoredraw = fl_get_button (ob); /* set the light on the button */ fl_set_button (ob, autoredraw); /* check if we need to replot */ boundaries (); } xplot-1.19/src/.header100644 1750 1750 2511 6730205545 13664 0ustar rhogeerhogeeThis file is part of the xplot program, a plot program for tabulated functions which works under X. Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. You may link this software with XForms (Copyright (C) by T.C. Zhao and Mark Overmars) and distribute the resulting binary, under the restrictions in clause 3 of the GPL, even though the resulting binary is not, as a whole, covered by the GPL. (You still need a separate license to do so from the owner(s) of the copyright for XForms, however). If a derivative no longer requires XForms, you may use the unsupplemented GPL as its license by deleting this paragraph and therefore removing this exemption for XForms. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA xplot-1.19/src/checkranges.c100644 1750 1750 6033 6025513367 15060 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" static void swap (double *a, double *b) { double tmp = *a; *a = *b; *b = tmp; } void checkranges () { register int xchanged = 0, ychanged = 0; if (curminx > curmaxx) { swap (&curminx, &curmaxx); xchanged++; } if (curminy > curmaxy) { swap (&curminy, &curmaxy); ychanged++; } if (curminx < minx) { xchanged++; curminx = minx; } if (curmaxx > maxx) { xchanged++; curmaxx = maxx; } if (curminy < miny) { ychanged++; curminy = miny; } if (curmaxy > maxy) { ychanged++; curmaxy = maxy; } if (curmaxx - curminx <= VERYTINY) { xchanged++; curminx = curmaxx - VERYTINY; } if (curmaxy - curminy <= VERYTINY) { ychanged++; curminy = curmaxy - VERYTINY; } } xplot-1.19/src/setboundary.c100644 1750 1750 5165 6025513367 15147 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void setboundary (FL_OBJECT *obj, long d) { double val; if (! sscanf (fl_get_input (obj), "%lf", &val)) return; switch (d) { case SET_MINX: curminx = val; break; case SET_MAXX: curmaxx = val; break; case SET_MINY: curminy = val; break; case SET_MAXY: curmaxy = val; break; } boundaries (); } xplot-1.19/src/setinputstrings.c100644 1750 1750 5121 6025512036 16055 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void setinputstrings () { char buf [80]; sprintf (buf, "%g", curminx); fl_set_input (minx_input, buf); sprintf (buf, "%g", curmaxx); fl_set_input (maxx_input, buf); sprintf (buf, "%g", curminy); fl_set_input (miny_input, buf); sprintf (buf, "%g", curmaxy); fl_set_input (maxy_input, buf); } xplot-1.19/src/helpdone.c100644 1750 1750 4745 6026004322 14374 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void help_done (FL_OBJECT *ob, long d) { /* re-activate help button */ fl_activate_object (help_button); /* terminate help browser */ fli_terminate_help_browser (help_browser); fl_hide_form (help); } xplot-1.19/src/settitle.c100644 1750 1750 4776 6077422167 14460 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void settitle (FL_OBJECT *ob, long data) { /* store title for plotting */ strncpy (titlestring, fl_get_input (ob), 255); titlestring [255] = '\0'; /* redraw if necessary */ if (autoredraw) redraw_plots (NULL, 0); } xplot-1.19/src/.makedist100755 1750 1750 537 6706675074 14241 0ustar rhogeerhogee#!/bin/sh echo "Making XPlot distribution..." echo "Refreshing headers." FLS=`ls -1 *.c *.h | egrep -v '^plot\.'` header -rk $FLS || exit 1 echo "Version: $1" # cd ../.. # tar cvzf xplot-$1.tar.gz xplot # ftp ftp << ENDFTP # cd /home/ftp/pub/karel/tounix # put xplot-$1.tar.gz # put xplot/xplot.README xplot.README # quit # ENDFTP xplot-1.19/src/showform.c100644 1750 1750 5052 6034217414 14441 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" static int nforms; void showform (FL_FORM *form, int placing, char *title) { fl_show_form (form, placing, FL_FULLBORDER, title); nforms++; } void hideform (FL_FORM *form) { fl_hide_form (form); nforms--; if (! nforms) { fl_finish (); exit (0); } } xplot-1.19/src/redrawplots.c100644 1750 1750 5262 6077421512 15151 0ustar rhogeerhogee/* <<< Start of information >>> */ /* This file is part of the xplot program, a plot program for */ /* tabulated functions which works under X. */ /* */ /* Copyright (c) ICCE / Karel Kubat 1995. All rights reserved. */ /* */ /* This program is free software; you can redistribute it and/or modify it */ /* under the terms of the GNU General Public License as published by the */ /* Free Software Foundation; either version 2 of the License, or (at your */ /* option) any later version. */ /* */ /* You may link this software with XForms (Copyright (C) by T.C. Zhao and */ /* Mark Overmars) and distribute the resulting binary, under the */ /* restrictions in clause 3 of the GPL, even though the resulting binary is */ /* not, as a whole, covered by the GPL. (You still need a separate license */ /* to do so from the owner(s) of the copyright for XForms, however). If a */ /* derivative no longer requires XForms, you may use the unsupplemented GPL */ /* as its license by deleting this paragraph and therefore removing this */ /* exemption for XForms. */ /* */ /* This program is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* */ /* You should have received a copy of the GNU General Public License */ /* along with this program; if not, write to the Free Software */ /* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* <<< End of information >>> */ #include "xplot.h" void redraw_plots (FL_OBJECT *ob, long d) /* arguments ignored */ { int i; redraw (small_plot, plot); /* redraw main plot */ for (i = 0; i < nblowups; i++) /* check blowups */ if (blowups [i].type == DYNAMIC_BLOWUP) /* if dynamic.. */ redraw (blowups [i].ob, /* redraw it */ blowups [i].form); } xplot-1.19/src/.makedist.orig100755 1750 1750 517 6151321734 15157 0ustar rhogeerhogee#!/bin/sh echo "Making XPlot distribution..." echo "Refreshing headers." FLS=`ls -1 *.c *.h | egrep -v '^plot\.'` header -rk $FLS || exit 1 echo "Version: $1" cd ../.. tar cvzf xplot-$1.tar.gz xplot ftp ftp << ENDFTP cd /home/ftp/pub/karel/tounix put xplot-$1.tar.gz put xplot/xplot.README xplot.README quit ENDFTP xplot-1.19/src/ChangeLog100644 1750 1750 1467 6706756372 14232 0ustar rhogeerhogee1999-04-19 Peter S Galbraith * Version 1.19 released. * New license approved by Karel Kubat (GPL + permission to link against XForms). * fgetline.c XPlot failed to read in lines that began with a minus sign or a decimal point. * xplot.c I am reversing the direction of the y-sliders to make the interface more intuitive. When a user slide down the first slider from its top position, the top of the y-axis scale will change instead of the _bottom_ of the y-axis. * xplot.1 New man page I had written for the Debian package of xplot-1.18 * plot.c #include * fli.h #include * xplot.h #include * libfli/lib/* Added libfli to archive, as well as building it to Makefile. * Makefile Various changes. xplot-1.19/src/xplot.1100644 1750 1750 17640 6636350740 13717 0ustar rhogeerhogee.TH XPLOT 1 .SH NAME xplot \- simple x-y column data plotter for X .SH SYNOPSIS .B xplot .I "[-v] [-title 'titlestring'] [-format 'formatstring'] [-y 'yrange'] [-display host:dpy] [-name appname] [-visual class] [-depth d] [-private] [-shared] [-stdcmap] [-debug l] [-sync] datafiles ..." .SH "DESCRIPTION" This manual page documents briefly the .BR xplot command. This manual page was written for the Debian GNU/Linux distribution using the program's intergrated help file because the original program does not have a manual page. .PP .B xplot is a small program to plot one- or twodimensional datasets, which are present either in a file or are generated `on-the-fly' and piped to XPlot. XPlot lets you display one or more datasets and lets you zoom to different sections of the sets. Also. `blowups' of the currently shown portion of the data can be made. .B xplot is meant for on-screen data exploration. It does not have a .I print button, nor is it meant for final output and publication-quality figures. .B xplot is non longer actively maintained upstream. If you would like to take it over, talk to the author: Karel Kubat . .SH OPTIONS A summary of options are included below. .TP .B \-v increases verbosity. XPlot prints information about what files are read and of how many points they consist when this flag is present. .TP .B \-title 'titlestring' defines the title for the plot (can also be set interactively). .TP .B \-format 'formatstring' The formatstring FORMAT is used to read in data. If you're familiar with C, then you know what a formatstring is. The default formatstring is "%f %f ", meaning that XPlot should try to interpret each line as two numbers (%f, for `floating point value'), separated by one or more whitespace characters. The -format flag can be handy if, e.g., you want to read in a file like time 12.0 value 3 time 12.1 value 4 time 12.2 value 5 You'd then have a format string "time %f value %f " Don't forget the trailing blank in the formatstring, it makes sure that the end-of-line character is skipped. .TP .B \-y yrange' This flag allows you to specify the range of the Y axis at startup. Normally XPlot determines the range from the read data. The YRANGE specifier must be in the form NUMBER:NUMBER (e.g., 0:13), where the first number specifies the lowest value of the Y axis, and the second number specifies the highest value. .SH XFORMS OPTIONS XPlot is built with the XForms Graphical User Interface Toolkit for X, and hence supports a number of flags which are interpreted by XForms. The flags must be stated before any file arguments, and are: .TP .B \-display host:dpy defines the X display. .TP .B \-name appname defines the application name. .TP .B \-visual class TrueColor, PseudoColor etc... .TP .B \-depth d visual depth in bits .TP .B \-private forces a private colormap. .TP .B \-shared forces a shared colormap. .TP .B \-stdcmap forces a standard colormap. .TP .B \-debug l prints debugging information, l is the level. .TP .B \-sync forces synchronous mode. .SH USING XPLOT .B The XPlot window The main XPlot window is called the `Control window'. It lets you select boundaries for the plot, activate or deactivate cetain datasets, etc.. See further the subsections. .B Boundaries of the plot The main XPlot window (called Control) shows the datasets in a small plot, surrounded by sliders. Two sliders are provided per axis, one selecting the minimum value and one selecting the maximum value. E.g., if you want to see the middle portion of the plot, set the upper horizontal slider (the minimum X value to display) to about 1/3 of its length and set the lower horizontal slider to 2/3 of its length. The boundaries of the plot can furthermore be entered in the input fields, below the small plot. One last button, labeled `Scale Y', affects the sizing of the graph. The button scales the Y axis to contain all points given a certain X range. The scaling of the Y axis is performed over all active datasets (you can also deactivate sets, see the appropriate section). .B Selecting and deselecting datasets When many datasets are plotted, it may be useful to deactivate (or later, reactivate) some of the sets. The button which is labeled `(De)activate sets', on the right hand side of the control window, starts a small window (called the `activator'), showing an overview of the plotted sets. The names of the active sets are prefixed with [+], the inactive sets are prefixed with [-]. Clicking on the line with a name of a dataset `toggles' the activity: an active set becomes inactive and v.v.. Initially, all datasets are `active' (i.e., displayed). The activator stays on-screen until you click the `dismiss' button of the activator window. .B Making larger plots: blowups The buttons `static blowup' and `dynamic blowup' in the control window start a `blowup' of the current plot: i.e. using the current borders and currently active sets. The blown up graph is dismissed by clicking in the blowup window. The blown up graph can be resized, e.g., to grab its contents in a paint program. The difference between a static and a dynamic blowup is the following. A static blowup will remain to show the the plotted data even when you, e.g., deactivate a set or change the boundaries. A static blowup is handy when e.g. you want to compare one part of the data with another part: make a static plot of the first part, move to the second part, and compare. In contrast, a dynamic plot redraws its data whenever necessary; therefore, it is an `enlargement' of the plot in the control window. XPlot can create an unlimited number of blowups: that way, you can simultaneously view different sets with different boundaries in different blowups.. .B Line types of the plots The radio buttons labelled `Line types', on the right hand side of the control window, select the line types for the plotting of the datasets. All sets are plotted in the same style. The default style, `solid or circles', plots a set either with a solid line, or with a solid line and circles on the separate points. The points are plotted when the graph contains less than 20 points: the idea here is that the presence of circles obfuscates a graph when more than 20 circles would be present in the graph. Other styles force either solid lines, solid lines with circles, or solid lines with squares. .B Postponed or immediate plotting The button labeled `Auto-redraw', on the right hand side of the Control window, selects whether XPlot should redo a plot when any change occurs (e.g., when the boundaries are altered or when a linestyle is defined). Initially, auto-redraw is `on'. Setting auto-redraw to `off' is a good idea when you are plotting large datasets. The reason for this is that the replotting of all sets (e.g., when sliding one of the boundary sliders) may take too long. In this case, you can disable the automatic redrawing, and `manually' redraw the plot when you are satisfied with all necessary changes. The `manual redraw' is always done when you press the button labeled `Redraw now'. .B Plot titles The input field labeled `Title', below the small plot on the Control window, lets you enter a title for the plot. XPlot's title facility is restricted to one title, which als used in blowups. You might want to define a title, make a blowup, and dump it to say a printer using `xwd' and related programs. .B Quitting XPlot The button labelled `dismiss' on the XPlot control window removes the control window from the screen. The XPlot program will only terminate when no blowups are on-screen. To quit XPlot, you need to remove all blowups (by clicking on them) and to click the `dismiss' button of the control window. .SH "SEE ALSO" This text is also available on-line help by pressing xplot's .B Help/About button. .SH AUTHOR xplot V1.18 Copyright (c) ICCE / Karel Kubat 1995 This manual page by Peter S Galbraith using info from /usr/share/xplot/xplot.help for the Debian GNU/Linux system (but may be used by others). xplot-1.19/COPYING100644 1750 1750 2420 6730205352 12672 0ustar rhogeerhogeeXPlot - a simple x-y column data plotter for X. Copyright (C) 1995 Karel Kubat. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. You may link this software with XForms (Copyright (C) by T.C. Zhao and Mark Overmars) and distribute the resulting binary, under the restrictions in clause 3 of the GPL, even though the resulting binary is not, as a whole, covered by the GPL. (You still need a separate license to do so from the owner(s) of the copyright for XForms, however). If a derivative no longer requires XForms, you may use the unsupplemented GPL as its license by deleting this paragraph and therefore removing this exemption for XForms. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA xplot-1.19/xplot.help100644 1750 1750 32004 6730205415 13700 0ustar rhogeerhogee [Introduction] [Copyright notice] [Obtaining XPlot] [Bug reports and wishlists] [Program invocation] [Command line arguments] [Format of the data] [Flag arguments] [The XPlot window] [Boundaries of the plot] [Selecting and deselecting datasets] [Making larger plots: blowups] [Line types of the plots] [Postponed or immediate plotting] [Plot titles] [Quitting XPlot] [Installing XPlot] [Compiling XPlot] [Introduction] @C4@l@b@i@cIntroduction XPlot is a small program to plot one- or twodimensional datasets, which are present either in a file or are generated `on-the-fly' and piped to XPlot. XPlot lets you display one or more datasets and lets you zoom to different sections of the sets. Also. `blowups' of the currently shown portion of the data can be made. [Copyright notice] @b@i@C4Copyright notice @i@cCopyright (C) 1995 Karel Kubat. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. You may link this software with XForms (Copyright (C) by T.C. Zhao and Mark Overmars) and distribute the resulting binary, under the restrictions in clause 3 of the GPL, even though the resulting binary is not, as a whole, covered by the GPL. (You still need a separate license to do so from the owner(s) of the copyright for XForms, however). If a derivative no longer requires XForms, you may use the unsupplemented GPL as its license by deleting this paragraph and therefore removing this exemption for XForms. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA [Obtaining XPlot] @C4@b@iObtaining XPlot XPlot can be obtained via anonymous ftp at the site ftp.icce.rug.nl, directory /pub/unix, files xplot*. You will need the archive xplot-X.YY.tar.gz (where X.YY is the version number); check this site for new versions. Once you unpack the archive, see the file xplot.help for more information about installation (this is in fact this text). [Bug reports and wishlists] @C4@b@iBug reports and wishlists I, the author, can be reached via e-mail at karel@icce.rug.nl. You can mail me if you have bug reports or specific wishes for XPlot. Please keep in mind that XPlot is meant to be an easy and fast datafile plotter, so don't mail me suggestions like "XPlot should be able to plot functions like y = sin(x)". XPlot will never calculate functions to plot them. Similarly, don't mail me that "XPlot doesn't have a PRINT button that sends the plot to my SuperMega LaserPrinter". XPlot is meant to show data on the screen. If you're shopping for a more `complete' program, check out gnuplot. If you encounter bugs in the XPlot program, mail me the full description of the error, the number of your version of XPlot, and preferably a datafile to demonstrate. I'll repair the bug when I find the time. Also, please CHECK the ftp site for newer versions of XPlot: it may well be that the bug was discovered previously and repaired. [Program invocation] @C4@l@b@i@cProgram invocation The program invocation is described in three subsections: command line arguments, format of the data, and flag arguments. [Command line arguments] @b@i@C4Command line arguments XPlot must be invoked by providing at least one source of data. That means that you can start XPlot as: xplot datafile(s) or as: command | xplot Several datafiles can be stated on the commandline, in which several lines are plotted (with different colors). XPlot can simultaneously show up to 11 datasets. Later you can interactively select or deselect the datasets that are simultaneously shown. XPlot currently supports the following flags: "-title STRING". The string is used as a title for the plot and can also be set interactively (see [Plot titles]). "-format FORMAT". The formatstring FORMAT is used to read in data. If you're familiar with C, then you know what a formatstring is. The default formatstring is "%f %f ", meaning that XPlot should try to interpret each linetwo as two numbers (%f, for `floating point value'), separated by one or more whitespace characters. The -format flag can be handy if, e.g., you want to read in a file like time 12.0 value 3 time 12.1 value 4 time 12.2 value 5 You'd then have a format string "time %f value %f ". Don't forget the trailing blank in the formatstring, it makes sure that the end-of-line character is skipped. "-v". This flag increases the `verbosity': XPlot prints information about what files are read and of how many points they consist when this flag is present. "-y YRANGE". This flag allows you to specify the range of the Y axis at startup. Normally XPlot determines the range from the read data. The YRANGE specifier must be in the form NUMBER:NUMBER, where the first number specifies the lowest value of the Y axis, and the second number specifies the highest value. When XPlot is started with incorrect arguments, usage information is shown. [Format of the data] @b@i@C4Format of the data XPlot supports either one- or twodimensional data. One-dimensional data consist of values, separated by newlines, one value per line. XPlot interprets this format as a series of Y values, to which X values are created by using 0 for the first X value, 1 for the next X value, etc.. Two-dimensional sets consist of two values per line, an X and an Y value. The values must be separated by whitespace characters (spaces or tabs). [Flag arguments] @b@i@C4Flag arguments XPlot is built with the XForms Graphical User Interface Toolkit for X, and hence supports a number of flags which are interpreted by XForms. The flags must be stated before any file arguments, and are: -display host:dpy (defines the X display) -name appname (defines the application name) -visual class (TrueColor, PseudoColor etc..) -depth d (visual depth in bits) -private (forces a private colormap) -shared (forces a shared colormap) -stdcmap (forces a standard colormap) -debug l (prints debugging information, l is the level) -sync (forces synchronous mode) [The XPlot window] @C4@l@b@i@cThe XPlot window The main XPlot window is called the `Control window'. It lets you select boundaries for the plot, activate or deactivate cetain datasets, etc.. See further the subsections. [Boundaries of the plot] @b@i@C4Boundaries of the plot The main XPlot window (called Control) shows the datasets in a small plot, surrounded by sliders. Two sliders are provided per axis, one selecting the minimum value and one selecting the maximum value. E.g., if you want to see the middle portion of the plot, set the upper horizontal slider (the minimum X value to display) to about 1/3 of its length and set the lower horizontal slider to 2/3 of its length. The boundaries of the plot can furthermore be entered in the input fields, below the small plot. One last button, labeled `Scale Y', affects the sizing of the graph. The button scales the Y axis to contain all points given a certain X range. The scaling of the Y axis is performed over all active datasets (you can also deactivate sets, see the appropriate section). [Selecting and deselecting datasets] @b@i@C4Selecting and deselecting datasets When many datasets are plotted, it may be useful to deactivate (or later, reactivate) some of the sets. The button which is labeled `(De)activate sets', on the right hand side of the control window, starts a small window (called the `activator'), showing an overview of the plotted sets. The names of the active sets are prefixed with [+], the inactive sets are prefixed with [-]. Clicking on the line with a name of a dataset `toggles' the activity: an active set becomes inactive and v.v.. Initially, all datasets are `active' (i.e., displayed). The activator stays on-screen until you click the `dismiss' button of the activator window. [Making larger plots: blowups] @b@i@C4Making larger plots: blowups The buttons `static blowup' and `dynamic blowup' in the control window start a `blowup' of the current plot: i.e. using the current borders and currently active sets. The blown up graph is dismissed by clicking in the blowup window. The blown up graph can be resized, e.g., to grab its contents in a paint program. The difference between a static and a dynamic blowup is the following. A static blowup will remain to show the the plotted data even when you, e.g., deactivate a set or change the boundaries. A static blowup is handy when e.g. you want to compare one part of the data with another part: make a static plot of the first part, move to the second part, and compare. In contrast, a dynamic plot redraws its data whenever necessary; therefore, it is an `enlargement' of the plot in the control window. XPlot can create an unlimited number of blowups: that way, you can simultaneously view different sets with different boundaries in different blowups.. [Line types of the plots] @b@i@C4Line types of the plots The radio buttons labelled `Line types', on the right hand side of the control window, select the line types for the plotting of the datasets. All sets are plotted in the same style. The default style, `solid or circles', plots a set either with a solid line, or with a solid line and circles on the separate points. The points are plotted when the graph contains less than 20 points: the idea here is that the presence of circles obfuscates a graph when more than 20 circles would be present in the graph. Other styles force either solid lines, solid lines with circles, or solid lines with squares. [Postponed or immediate plotting] @b@i@C4Postponed or immediate plotting The button labeled `Auto-redraw', on the right hand side of the Control window, selects whether XPlot should redo a plot when any change occurs (e.g., when the boundaries are altered or when a linestyle is defined). Initially, auto-redraw is `on'. Setting auto-redraw to `off' is a good idea when you are plotting large datasets. The reason for this is that the replotting of all sets (e.g., when sliding one of the boundary sliders) may take too long. In this case, you can disable the automatic redrawing, and `manually' redraw the plot when you are satisfied with all necessary changes. The `manual redraw' is always done when you press the button labeled `Redraw now'. [Plot titles] @b@i@C4 Plot titles The input field labeled `Title', below the small plot on the Control window, lets you enter a title for the plot. XPlot's title facility is restricted to one title, which als used in blowups. You might want to define a title, make a blowup, and dump it to say a printer using `xwd' and related programs. [Quitting XPlot] @b@i@C4 Quitting XPlot The button labelled `dismiss' on the XPlot control window removes the control window from the screen. The XPlot program will only terminate when no blowups are on-screen. To quit XPlot, you need to remove all blowups (by clicking on them) and to click the `dismiss' button of the control window. [Installing XPlot] @C4@l@b@i@cInstalling XPlot XPlot is contained in an archive xplot-X.YY.tar.gz, available via anonymous ftp, at the site ftp.icce.rug.nl, directory /pub/unix. Check there for newest versions. Once you obtain the archive xplot-X.YY.tar.gz (X.YY being a version number, say 1.00), unpack the archive in a `sources' directory, preferably /usr/local/src: @f tar xvzf xplot-X.YY.tar.gz The archive spills its contents into a subdirectory xplot. The actual sources are in xplot/src. Change-dir to this directory: @f cd xplot/src [Compiling XPlot] @b@i@C4Compiling XPlot In order to compile XPlot, you will need two additional libraries and header files: the XForms library and header (a graphical user interface toolkit for X) and the Fli library and header (ICCE add-ons for XForms). See the file Makefile in the xplot/src directory for an overview of XForms ftp sites. The Fli library is included with XPlot sources, and it built automatically. Not that those who want to use the Fli library in their own project should download it from ftp://ftp.icce.rug.nl/pub/unix/libfli-X.tar.gz beacuse it may be more up-to-date, and that packages also includes extras (xfliman). When you have obtained XForms version 0.88 (or even 0.81), edit the Makefile and adjust the macros at the top. You can specify your `bin' directory, used for a `make install' and other things. Generally, the Makefile won't need tweaking. Next, try a `make tests' in the sources directory. You should see plots with a couple of different datafiles. When you are satisfied, do a `make install': this will copy the executable and its helpfile to their destinations. xplot-1.19/xplot.README100644 1750 1750 1262 6706747727 13713 0ustar rhogeerhogee ============================================================================ X P L O T ============================================================================ XPlot is a simple data plotter for X. It's designed to show one- or twodimensional datasets, either from a file or from a pipe. Once you extract the archive in which xplot is distributed, read the on-line helpfile xplot.help for installation- and compilation guidelines. The helpfile is in an internal format, meant to be displayed once you press the `help' button of XPlot. Just ignore the control codes and read it as if it were a flat ascii file. There's also a man page. Karel Kubat karel@icce.rug.nl xplot-1.19/libfli/ 40755 1750 1750 0 6707141775 13021 5ustar rhogeerhogeexplot-1.19/libfli/README100644 1750 1750 627 6707141767 13764 0ustar rhogeerhogee FLI: ICCE Add-Ons for the XForms Graphical User Interface This is _not_ the full distribution set of FLI. This is a package for libfli.a with build definitions (lib/cbuild.def) that don't install the library; we only use it to build xplot. If you want to use FLI for your own projects (along with its devel tool xfliman), get it separately from: ftp://ftp.icce.rug.nl/pub/unix/libfli-0.1.tar.gz xplot-1.19/libfli/.makedist100755 1750 1750 1517 6032500565 14712 0ustar rhogeerhogee#!/bin/sh echo "Making libfli distribution..." echo "Getting version." if [ ! -f .version ] ; then echo "File .version not found. Cannot make distribution!" exit 1 fi VER=`awk '{ printf ("Last version: major=%s, minor=%s\n", $1, $2) > "/dev/stderr"; $2 += 1; printf ("New version: major=%s, minor=%s\n", $1, $2) > "/dev/stderr"; printf ("%1d.%d", $1, $2); printf ("%s %s\n", $1, $2) > ".version"; }' .version` echo "New distribution version: $VER" echo "Making archive." cd .. tar cvzf libfli-$VER.tar.gz libfli echo "Uploading." ftp -n << ENDFTP open ftp user ftp karel@ cd /pub/incoming/general put libfli-$VER.tar.gz put libfli/README libfli.README quit ENDFTP echo "Done. Remember to move from /pub/incoming/general to /pub/unix!" echo "Removing locally built archive.." rm libfli-$VER.tar.gz xplot-1.19/libfli/.version100644 1750 1750 4 6032500570 14475 0ustar rhogeerhogee0 1 xplot-1.19/libfli/lib/ 40755 1750 1750 0 6730205602 13551 5ustar rhogeerhogeexplot-1.19/libfli/lib/cbuild100755 1750 1750 23743 6707141503 15072 0ustar rhogeerhogee#!/bin/sh ############### configurable settings, can be overruled in cbuild.def CC=g++ CFLAGS="-c -Wall -O2 -g" LFLAGS="-O2" LIBNAME=cbuild ARFLAGS=rv RANLIB=ranlib OTHERLIBDIRS="" OTHERLIBS="" DESTPROG="" INSTALL="" EDITOR='xrun jove +$LINE $FILE' ############### print error msg and die error () { echo "$PROG": $* exit 1 } ############### print a message string message () { echo "$PROG": $* } ############### now source cbuild.def if it exists if [ -f "cbuild.def" ] ; then . cbuild.def || error syntax error in cbuild.def fi ############### non-configurable settings VER=0.05 PROG=`basename $0` STARTDIR=`echo $PWD` FULLLIB="$STARTDIR/lib$LIBNAME.a" CHANGES=no ############### run: run a command or exit upon failure run () { tmpfile=/tmp/cbuild.$$.out message "$*" $* > $tmpfile 2>&1 result=$? cat $tmpfile if [ $result -ne 0 ] ; then message program $1 reports error # see if we can parse the output and invoke the editor if [ "$1" = "g++" -o "$1" = "gcc" ] ; then if [ "$EDITOR" != "" ] ; then errmsg=`egrep '^[a-zA-Z]+\.[a-zA-Z]+:[0-9]+' $tmpfile | \ head -1` FILE=`echo $errmsg | awk -F: '{print $1}'` LINE=`echo $errmsg | awk -F: '{print $2}'` message starting editor eval "$EDITOR" rm $tmpfile fi fi error aborted. fi rm $tmpfile } ############### compiledir: compile all in current dir, # place objects in STARTDIR, given prefix $1 to be used for object files compiledir () { ccfiles=`ls -1 *.cc *.c 2>/dev/null` hfile=`ls -1 *.h 2>/dev/null` if [ -z "$hfile" -o ! -f "$hfile" ] ; then message warning: no header file found in this directory else touched=no for ccfile in $ccfiles ; do if [ $hfile -nt $ccfile -a $touched = no ] ; then message header "$hfile" is newest, touching all sourcefiles run touch "$ccfiles" touched=yes fi done fi for ccfile in $ccfiles ; do ofile="$STARTDIR/$1$ccfile" ofile=`echo $ofile | sed 's/\.c/.o/g' | sed 's/\.oc/.o/g'` compileit=no if [ -f $ofile ] ; then if [ $ccfile -nt $ofile ] ; then compileit=yes fi else if [ ! -f "$FULLLIB" -o $ccfile -nt "$FULLLIB" ] ; then compileit=yes fi fi if [ $compileit = yes ] ; then run "$CC" "$CFLAGS" $ccfile -o $ofile CHANGES=yes fi done } ############### build all classes in subdirs buildclasses () { dirs=`cat cbuild.classes` if [ "$dirs" = "" ] ; then message no subclasses to compile else message will build subclasses: $dirs prefix=1 for d in $dirs ; do message building subclass: $d cd $d || error cannot changedir to $d compiledir $prefix cd "$STARTDIR" prefix=`expr $prefix + 1` done fi } ############### make test programs in subdirs/test, one testprog per file maketest () { dirs=`cat cbuild.classes` message checking for test progs for d in $dirs ; do if [ -d $d/test ] ; then cd $d/test || error cannot changedir to $d/test ccfiles=`ls *.cc 2>/dev/null` for ccfile in $ccfiles ; do out=`echo $ccfile | sed 's/\.cc//g'` if [ ! -f $out -o $ccfile -nt $out -o "$CHANGES" = "yes" ] then message making test program $d/test/$ccfile if [ "$OTHERLIBDIRS" = "" ] ; then Lflag="-L$STARTDIR" else Lflag="-L$STARTDIR $OTHERLIBDIRS" fi if [ "$OTHERLIBS" = "" ] ; then lflag="-l$LIBNAME" else lflag="-l$LIBNAME $OTHERLIBS" fi run "$CC $LFLAGS -o $out $ccfile $Lflag $lflag" fi done cd $STARTDIR fi done } ############### makelib: combine objects into one FULLLIB makelib () { objects=`ls *.o 2>/dev/null` if [ ! -z "$objects" ] ; then run "ar $ARFLAGS $FULLLIB $objects" if [ ! -z "$RANLIB" ] ; then run ranlib "$FULLLIB" fi run "rm $objects" CHANGES=yes fi } ############### makedestprog: make the final program from the lib makedestprog () { message "making destination program $DESTPROG" if [ "$OTHERLIBDIRS" = "" ] ; then Lflag="-L$STARTDIR" else Lflag="-L$STARTDIR $OTHERLIBDIRS" fi if [ "$OTHERLIBS" = "" ] ; then lflag="-l$LIBNAME" else lflag="-l$LIBNAME $OTHERLIBS" fi if [ ! -f "$DESTPROG" -o "$FULLLIB" -nt "$DESTPROG" ] ; then run "$CC $LFLAGS -o $DESTPROG $Lflag $lflag" else message "destination program $DESTPROG is up to date" fi } ############### makeinstall: run the final installation makeinstall () { if [ "$INSTALL" != "" ] ; then run "$INSTALL" fi if [ "$INSTALL1" != "" ] ; then run "$INSTALL1" fi if [ "$INSTALL2" != "" ] ; then run "$INSTALL2" fi if [ "$INSTALL3" != "" ] ; then run "$INSTALL3" fi } ############### show divers help helpme () { if [ "$1" = "help" ] ; then cat << ENDHELP The cbuild script is a generic compiler driver, though directed towards C++ programs with class sources in subdirectories. Try: "cbuild whatfor" for general info "cbuild files" for resource files descriptions "cbuild def" for an overview of settings in resource cbuild.def "cbuild mangling" for the internally used name mangling "cbuild author" for my name/address. ENDHELP elif [ "$1" = "author" ] ; then cat << ENDHELP cbuild by Karel Kubat (karel@icce.rug.nl). Please mail me suggestions or bug reports, I'll do what I can to fix or incorporate features (if I find the time..). ENDHELP elif [ "$1" = "whatfor" ] ; then cat << ENDHELP The cbuild script is meant to compile your C++ programs, given the following setup: some directory with sources, say ~/cc subdirectories with classes, say ~/cc/oneclass and ~/cc/otherclass cbuild will compile all .cc files in the current directory and in underlying class subdirectories and place the resulting objects in one library. The program can then be constructed from that library. The big advantage over make is that you don't have to specify all source files, cbuild does that for you. The big disadvantage is that cbuild has only little dependency checking. cbuild relies on resource (definition) files, try "cbuild files" for info. Oh, and cbuild will work for .c files too. ENDHELP elif [ "$1" = "files" ] ; then cat << ENDHELP The first relevant file is "cbuild.classes". You must list the subdirectories which contain class sources here. E.g., given two subdirs "oneclass" and "otherclass", each containing sources, your resource file "cbuild.classes" would look as: oneclass otherclass You never have to specify the current directory in cbuild.classes, that's implicit. If you don't have subdirectories, don't create cbuild.classes or leave that file empty. This file is used in cbuild's name mangling, try "cbuild mangling" for info. Another optional though useful resource file is "cbuild.def", which defines some variables. Try "cbuild def" for info. ENDHELP elif [ "$1" = "mangling" ] ; then cat << ENDHELP cbuild will mangle object file names before these objects are placed into the library. The purpose is that more class subdirectories may contain the same filenames, e.g. oneclass/init.cc can coexist with otherclass/init.cc. The trick is that these files lead to 1init.o and 2init.o, which will occur separately in the library. You don't need to worry about name mangling, just be glad that it's there. cbuild constructs the prefix for all objects (1, 2, etc.) using the line count in the definition file "cbuild.classes". Say you have three subdirs oneclass anotherclass thirdclass specified in this order in cbuild.classes. A source file init.cc from thirdclass is then mangled into the object file 3init.o. ENDHELP elif [ "$1" = "def" ] ; then cat << ENDHELP The resource file cbuild.def may contain variables, all in the form VARIABLE=value Used variables are: CC: your favorite C++ compiler, default is "g++". CFLAGS: compilation flags, default is "$CFLAGS". Useful setting is e.g. "-c -g" to include debugging code. LFLAGS: linker flags, default is "$LFLAGS". Useful setting is again "-g". LIBNAME: the name of the destination library, default is "$LIBNAME" which gives you "lib$LIBNAME.a". E.g., if you're constructing a program "rm", you might want "librm.a" -- so you'd set this to "rm". ARFLAGS: flags to pass to ar, default is "$ARFLAGS". RANLIB: your ranlib program, set to "" if you don't have / need one. OTHERLIBS: other libraries besides LIBNAME you might need. A useful setting is e.g. "-lbsd". Note: include the "-l" flag in this name. Default is empty. OTHERLIBDIRS: other library-containing directories than the current dir, e.g. /home/user/divers/libsuper.a would be linked to the program with OTHERLIBS="-lsuper" OTHERLIBDIRS="-L/home/user/divers" DESTPROG: the final program to build using the constructed library and possibly other libs. Default: nothing, which only constructs the library. E.g.: DESTPROG=/usr/bin/myprog INSTALL: possible last installation actions, default is nothing. E.g.: INSTALL="cp myprog.1 /usr/man/man1". Similarly, you have three more: INSTALL1, INSTALL2, INSTALL3. EDITOR: Given the compiler "g++" or "gcc", cbuild will try to invoke your favorite editor when compilation fails. Set EDITOR to an empty string if you don't want this behavior, or state your editur using $FILE for the filename and $LINE for the line number. Default is: EDITOR='xrun bjove +\$LINE \$FILE' # my default ENDHELP else error no such help subject, try cbuild help fi exit 1 } ############### main prog # banner message Version "$VER" if [ "$1" != "" ] ; then helpme $* fi # check for class subdirs definition if [ ! -f "cbuild.classes" ] ; then message "cbuild.classes not found, assuming no subdirs" else # build classes in subdirs buildclasses fi # build classes in startdir message compiling in "$STARTDIR" compiledir # combine objects into one lib, make test progs if [ "$CHANGES" = "yes" ] ; then makelib fi if [ -f "cbuild.classes" ] ; then maketest fi if [ "$DESTPROG" != "" ] ; then makedestprog else message "No DESTPROG setting in cbuild.def, not making program." fi makeinstall xplot-1.19/libfli/lib/cbuild.classes100644 1750 1750 56 6031745056 16436 0ustar rhogeerhogeehelpbrowser colorlookup colormapping geometry xplot-1.19/libfli/lib/cbuild.def100644 1750 1750 264 6706706314 15563 0ustar rhogeerhogeeCC=gcc CFLAGS="-c -O2 -I.. -I. -I/usr/X11R6/include/X11" LIBNAME="fli" #INSTALL1="cp -p fli.h /usr/local/include" #INSTALL2="cp -p libfli.a /usr/local/lib" INSTALL1="" INSTALL2="" xplot-1.19/libfli/lib/fli.h100644 1750 1750 4243 6706705112 14600 0ustar rhogeerhogee /* fli.h: ICCE Add-ons for XForms */ #ifndef _FLI_H_ #define _FLI_H_ #include #ifdef __cplusplus extern "C" { #endif /* Help browser definitions - KK sept 95. */ /* ====================================== */ /* load helpfile into browser, return 0 on success; 1 = file not found, 2 = other fault (memory) */ extern int fli_load_help_browser (FL_FORM *form, FL_OBJECT *textbrowser, FL_OBJECT *contentsbrowser, FL_OBJECT *indexbrowser, char const *fname); /* terminate help browser */ extern void fli_terminate_help_browser (FL_OBJECT *obj); /* Data types, functions and variables for internal usage */ typedef struct { FL_OBJECT *textbrowser, *contentsbrowser, *indexbrowser; FILE *f; FL_FORM *form; } FLI_HELP_BROWSER; extern FLI_HELP_BROWSER *fli_help_browser; extern int nfli_help_browser; /* callback that makes the browser clickable.. internal function */ extern void fli_help_browser_cb (FL_OBJECT *obj, long data); /* callback that makes the browser clickable.. internal function */ extern void fli_parse_helpfile (int index); /* Color lookup definitions - KK sept. 95 */ /* ====================================== */ /* where is the color database? */ # define FLI_RGB_DATABASE "/usr/lib/X11/rgb.txt" /* look up a color, return 0 on success, 1 on database not found, 2 on color not found */ extern int fli_lookup_color (char const *col, int *r, int *g, int *b); /* Geometry parsing and applying - KK sept. 95 */ /* =========================================== */ /* parse a geometry string.. returns a bitmask of: */ # define FLI_WH_PARSED 1 /* width/height parsed */ # define FLI_XY_PARSED 2 /* x/y parsed */ # define FLI_WHXY_PARSED 3 /* both */ /* zero return value: error */ extern int fli_parse_geometry (char const *geom, int *x, int *y, int *w, int *h); /* parse a geometry string and apply it to a form, return types same as above */ extern int fli_apply_geometry (FL_FORM *form, char const *geom); #ifdef __cplusplus } #endif #endif /* _FLI_H_ */ xplot-1.19/libfli/lib/helpbrowser/ 40755 1750 1750 0 6026245055 16111 5ustar rhogeerhogeexplot-1.19/libfli/lib/helpbrowser/flihelpbrowsercb.c100644 1750 1750 2721 6027227130 21703 0ustar rhogeerhogee #include #include #include #include void fli_help_browser_cb (FL_OBJECT *ob, long data) { register int thisindex = (int) data, active = 0; register FILE *f = fli_help_browser [thisindex].f; char selection [1025], buf [1025], *cp; register FL_FORM *form = fli_help_browser [thisindex].form; register FL_OBJECT *textw = fli_help_browser [thisindex].textbrowser; /* determine clicked selection, put it in variable selection */ strcpy (buf, fl_get_browser_line (ob, fl_get_browser (ob))); if (ob == textw) /* for text window, strip off [] */ { if (sscanf (buf, "%*[^[][%s]", selection) < 1) return; if (! (cp = strchr (selection, ']')) ) return; * (cp + 1) = '\0'; } else /* for index/contents, strip off whitesp */ { cp = buf; while (isspace (*cp)) cp++; strcpy (selection, cp); if ( (cp = strchr (selection, '\n')) ) *cp = '\0'; strcat (selection, "]"); } /* selection is now the string and a terminating ] , but not the leading [ */ rewind (f); fl_clear_browser (textw); fl_freeze_form (form); while (1) { fgets (buf, 1024, f); if (feof (f)) break; if (buf [0] == '[') { if (active) break; else if (! strncmp (buf + 1, selection, strlen (selection))) active = 1; } else { if (active) fl_add_browser_line (textw, buf); } } fl_unfreeze_form (form); /* all done */ } xplot-1.19/libfli/lib/helpbrowser/fliloadhelpbrowser.c100644 1750 1750 2604 6026034666 22247 0ustar rhogeerhogee #include #include #include FLI_HELP_BROWSER *fli_help_browser; int nfli_help_browser; int fli_load_help_browser (FL_FORM *form, FL_OBJECT *textb, FL_OBJECT *contentsb, FL_OBJECT *indexb, char const *fname) { register FILE *f; /* clear browsers */ fl_clear_browser (textb); fl_clear_browser (indexb); fl_clear_browser (contentsb); /* try to open file */ if (! (f = fopen (fname, "r")) ) return (1); /* enter the data */ if (! (fli_help_browser = (FLI_HELP_BROWSER *) realloc (fli_help_browser, (nfli_help_browser + 1) * sizeof (FLI_HELP_BROWSER))) ) return (2); fli_help_browser [nfli_help_browser].textbrowser = textb; fli_help_browser [nfli_help_browser].contentsbrowser = contentsb; fli_help_browser [nfli_help_browser].indexbrowser = indexb; fli_help_browser [nfli_help_browser].f = f; fli_help_browser [nfli_help_browser].form = form; /* parse first section */ fli_parse_helpfile (nfli_help_browser); /* parsed.. */ fl_set_object_callback (textb, fli_help_browser_cb, (long) nfli_help_browser); fl_set_object_callback (contentsb, fli_help_browser_cb, (long) nfli_help_browser); fl_set_object_callback (indexb, fli_help_browser_cb, (long) nfli_help_browser); nfli_help_browser++; /* return success */ return (0); } xplot-1.19/libfli/lib/helpbrowser/fliparsehelpfile.c100644 1750 1750 3110 6027230411 21652 0ustar rhogeerhogee #include #include #include #include void fli_parse_helpfile (int index) { register FL_FORM *form = fli_help_browser [index].form; register FL_OBJECT *indexwin = fli_help_browser [index].indexbrowser, *contentswin = fli_help_browser [index].contentsbrowser; char buf [1025]; register char *entry, *cp; register int i, sorted; register FILE *f = fli_help_browser [index].f; /* don't display right now */ fl_freeze_form (form); /* read lines matching [entry] with spaces before the first [ */ while (1) { fgets (buf, 1024, f); if (feof (f) || ! isspace (buf [0]) || ! (entry = strchr (buf, '['))) break; strcpy (entry, entry + 1); if (! (cp = strchr (entry, ']')) ) break; *cp = '\0'; /* put whole entry line into contents */ fl_add_browser_line (contentswin, buf); /* put line without leading spaces into index */ fl_add_browser_line (indexwin, entry); } /* re-sort index window */ sorted = 0; while (! sorted) { sorted = 1; for (i = 2; i <= fl_get_browser_maxline (indexwin); i++) { register char const *one = fl_get_browser_line (indexwin, i - 1), *two = fl_get_browser_line (indexwin, i); if (strcasecmp (one, two) > 0) { char buf [1024]; strcpy (buf, one); fl_replace_browser_line (indexwin, i - 1, two); fl_replace_browser_line (indexwin, i, buf); sorted = 0; } } } /* show the form now */ fl_set_browser_topline (contentswin, 1); fl_set_browser_topline (indexwin, 1); fl_unfreeze_form (form); } xplot-1.19/libfli/lib/helpbrowser/fliterminatehelpbrowser.c100644 1750 1750 611 6026035404 23263 0ustar rhogeerhogee #include #include void fli_terminate_help_browser (FL_OBJECT *ob) { register int i; /* search for that object, close the file */ for (i = 0; i < nfli_help_browser; i++) if (fli_help_browser [i].textbrowser == ob || fli_help_browser [i].contentsbrowser == ob || fli_help_browser [i].indexbrowser == ob ) fclose (fli_help_browser [i].f); } xplot-1.19/libfli/lib/helpbrowser/helpbrowser.fliman100644 1750 1750 27024 6027522256 21761 0ustar rhogeerhogee [Author] [Introduction] [Functions] [fli_load_help_browser()] [fli_terminate_help_browser()] [Example] [Initial actions] [How the help text is shown] [How the help text is removed] [Format of the help file] [Anchors and links] [Sections] [Control sequences] [Caveats] [Author] @C4@i@lAuthor Karel Kubat (karel@icce.rug.nl) [Introduction] @C4@i@lIntroduction The helpbrowser functions are designed to provide an easy way to load program-specific help information into a three-browser form, where the user can select helptext sections from (a) a "table of contents" browser, (b) an "index" browser, or (c) from links in the actual text. The helpbrowser functions do NOT implement a full hyperlink help system (use http browsers for that ;-) but just a simple-to-use system for short helptexts. Before using the help browser functions, you'll need: a. A helpfile. This file must be organized in a special way, parse-able by the helptext functions. b. A form, with three predefined browsers in it: a contents-, an index- and a text browser. You'll probably want to put a `done' button in the form as well. [Functions] @C4@i@lFunctions There are two top-level functions: fli_load_help_browser() and fli_terminate_help_browser(). A few internally used functions exist (e.g., to parse the helpfile), but they are not described here. [fli_load_help_browser()] @C4@ifli_load_help_browser() @iFunction prototype int fli_load_help_browser (FL_FORM *form, FL_OBJECT *textbrowser, FL_OBJECT *contentsbrowser, FL_OBJECT *indexbrowser, char const *filename) @iArguments form - the form containing the text/contents/index browsers textbrowser - browser object to receive helptext to view contentsbrowser - browser to receive table of contents indexbrowser - browser to receive index filename - file containing help text definition @iReturn value 0 - text loaded 1 - file could not be opened 2 - memory allocation failed @iActions of the function Fills the contents and index browsers and defines its own callback routine, but DOES NOT put the form on the screen. The caller must do that. The textbrowser will be filled with user-elected text information. NOTE THAT the three browsers must be of the type FL_SELECT_BROWSER, since the user must be able to make a selection from the shown text. [fli_terminate_help_browser()] @C4@ifli_load_help_browser() @iFunction prototype void fli_terminate_help_browser (FL_OBJECT *browser) @iArguments browser - one of the used browsers, i.e., the textbrowser, contentsbrowser or indexbrowser from the fli_load_help_browser() call. @iActions Does internal bookkeeping. Does NOT remove the form from the screen, the caller should do that if requested. [Example] @C4@i@lExample Note again that you need a form with three selectable browsers, before you can use the helpbrowser functions. The three browsers must be in a predefined form. In this example, we'll assume that a button `help' exists in one of the forms which are on-screen, which, when pressed, fires up the helpform. The helpform itself shows the help information and can be de-activated with a `quit help' button. [Initial actions] @C4@iInitial actions As mentioned before, you need a form with three browsers to receive the help text itself, its table of contents, and the index. Usually, it's a good idea to create a form that looks a bit like this: browser for browser for contents index Largest browser for the helptext itself The form's largest browser should be the one to receive the actual help text. The contents- and index-browsers are smaller; the index browser can be actually the smallest. Since the whole form can be dismissed (as assumed in this example), the form should furthermore contain a `done' button. This is no prerequisite per se: situations can arise where a help browser should be on-screen permanently. [How the help text is shown] @C4@iHow the help text is shown This section presents a code example of the actual showing of help text. Let's assume that a button `help' has a callback function, that fires up a predefined helpform with the three browsers, and puts it onscreen. This function calls fli_load_browser_helpfile(). Example: /* dohelp() is called when the user presses a `help' button */ /* -------------------------------------------------------- */ /* the help filaname */ #define HELPFILE "/usr/local/etc/myhelp.dat" extern FL_FORM *help; /* form containing 3 browsers */ extern FL_OBJECT *help_browser, /* 3 FL_SELECT_BROWSER type */ *help_contents_browser, /* browsers in the form */ *help_index_browser; void dohelp (FL_OBJECT *ob, long d) { static char *notloaded [] = /* failure message */ { "Sorry, help unavailable.", "The help file was not found or could not", "be loaded.", }; register int i; /* counter */ /* deactivate help button */ fl_deactivate_object (ob); /* load browser */ if (fli_load_help_browser (help, help_browser, help_contents_browser, help_index_browser, HELPFILE)) for (i = 0; i < (sizeof (notloaded) / sizeof (char *)); i++) fl_add_browser_line (help_browser, notloaded [i]); /* show the form */ fl_show_form (help, FL_PLACE_SIZE | FL_PLACE_MOUSE, FL_FULLBORDER, "HELP!"); } Following this call, the help screen is shown and information is automatically displayed in it. Assuming that the XForms loop cycle is already running (i.e., that the program is already in a fl_do_forms() loop), this is all that's needed. [How the help text is removed] @C4@iHow the help text is removed You'll probably want the help form to finish somehow. To achieve this, you need to define a `stop help' button in the helpform, calling the following callback function: /* help_done(): called when user presses `done with help' button */ /* ------------------------------------------------------------- */ extern FL_OBJECT *help_button, /* button that fires up help */ *help_browser; /* any of the browsers in the helpform */ extern FL_FORM *help; /* help form itself */ void help_done (FL_OBJECT *ob, long d) { /* re-activate help button, was deactivated in dohelp() above */ fl_activate_object (help_button); /* terminate help browser */ fli_terminate_help_browser (help_browser); /* remove help form from the screen */ fl_hide_form (help); } That's all that's to it, given the right format of the helpfile. That is discussed in section [Format of the help file]. [Format of the help file] @C4@i@lFormat of the help file The helpfile contains three types of information: anchors, links, and other (textual) information. Furthermore, the helpfile has two sections: the table of contents (which is only partly displayed) and the actual helptext itself (which is fully displayed). [Anchors and links] @C4@iAnchors and links Nomenclature: anchors, links and textual information. @iAnchor An ANCHOR is text in square brackets, occurring at the first column of the file. It just defines that some sections starts at this point. Example (the | character means: beginning of line): |[Introduction] | |@C1@lIntroduction This means: an anchor called Introduction starts here, defined by [Introduction]. This actual section begins with one empty line, followed by the text `Introduction', color red, large font. (Actually, since this document also has an introductory section, you could click on it and jump to the intro.) @iLink A LINK looks the same as an anchor, but does not occur on the first column. Example: | See further section [Introduction]. This link of course points to the introduction section, defined by an anchor [Introduction]. Links have furthermore an important role because they must be used at the top of the helpfile to define the table of contents, but that is discussed below in [Sections]. @iTextual information TEXTUAL INFORMATION is just everything except for anchors or links; such as this line of text. [Sections] @C4@iSections The helpfile must contain two sections: the (partly displayed) table of contents, and the (displayed) actual helptext. @iThe table of contents The first section MUST BE the table of contents, and contain links to the rest of the document. Example (the | character again denotes the leftmost column): | [Introduction] | [Copyright notice] | [Program invocation] | [Flags] | [File arguments] This table of contents must occur at the top of the file. It has links, since the [...] items don't start at the first column. Furthermore the links are indented, but that's only for cosmetical reasons. This cosmetical reason is the following: the contents browser will contain the linknames, without the braces, but with leading spaces. When you therefore use an indentation in the table of contents to suggest subsectioning, the contents browser will also show this indentation. The help-browser functions use this table of contents to fill the contents browser with links (without the [] around the link names). Furthermore, this table is also used to construct the index: that is simply a sorted list of the mentioned links, without any indentation. (Therefore, you can choose to make the index browser somewhat smaller than the contents browser -- the index browser doesn't need space for indentation). @iActual helptext The second section of the file is the actual information, which must contain anchors and information to show to the user. This section by definition starts with the first anchor of the file. Note that the anchors themselves are NOT shown in the text browser, so it's a good idea to provide a title for the text, as in: |[Introduction] | |@C4@l@iIntroduction | |Welcome to .......... This example shows (a) an anchor, with (b) the name repeated underneat in blue, large italic font. The name is repeated because the anchor itself will not be displayed. Following the name, the actual contents of this section starts. If you provide links in this section, then the links are shown WITH the surrounding square brackets (this in contrast to the table of contents, where the square brackets are removed). [Control sequences] @C4@iControl sequences The `control sequences' which you can use in a text browser to change the appearance of text are documented in the XForms guide. Below is a summarizing table: @f @b boldface @f @i italics @f @f fixed font @f @l large font @f @s small font @f @c centered text @f @r right-aligned text @f @_ underlined @f @Cn color code, only some are shown: @f @C0 is black @f @C1 is red @f @C2 is green @f @C3 is yellow @f @C4 is blue @f @C5 is magenta @f @C6 is cyan @f @C7 is white @f @C8 is tomato @f @C9 is indian red @f @C10 is slate blue [Caveats] @C4@i@lCaveats @iDead anchors Remember that an anchor is not shown in the text, and that the information following it never appears unless a link with the same name is somehow selected. In general, you should state all anchors in the table of contents at the top of the file. An exception might be a `footnote'-like comment, with its own anchor and without link in the table of contents --- but with a link somewhere in the running text. @iDead links Once the user clicks on a link, the corresponding section is searched for in the helpfile. If it is not found, the text browser remains emptly. So, when you see an empty browser after clicking some text, CHECK THE LINK NAME! xplot-1.19/libfli/lib/colorlookup/ 40755 1750 1750 0 6027501056 16122 5ustar rhogeerhogeexplot-1.19/libfli/lib/colorlookup/flilookupcolor.c100644 1750 1750 1574 6027525460 21442 0ustar rhogeerhogee #include #include #include #include int fli_lookup_color (char const *col, int *r, int *g, int *b) { register FILE *f; char buf [200]; register int ret; int red, green, blue; register char *cp; /* try to open the file */ if (! (f = fopen (FLI_RGB_DATABASE, "r")) ) return (1); /* assume color not found */ ret = 2; while (1) { fgets (buf, 199, f); if (feof (f)) break; /* scan for RGB components */ if (sscanf (buf, "%d %d %d", &red, &green, &blue) < 3) continue; /* advance to first character */ cp = buf; while (! isalpha (*cp) && *cp) cp++; if (! *cp) continue; if (! strncmp (col, cp, strlen (col)) ) { *r = red; *g = green; *b = blue; ret = 0; break; } } /* close the file, return */ fclose (f); return (ret); } xplot-1.19/libfli/lib/colorlookup/colorlookup.fliman100644 1750 1750 4111 6027512464 21761 0ustar rhogeerhogee [Author] [Introduction] [fli_lookup_color()] [Example] [Caveats] [Author] @C4@i@lAuthor Karel Kubat (karel@icce.rug.nl) [Introduction] @C4@i@lIntroduction The function fli_lookup_color() is designed to scan through the RGB database file and to look up a color. The red/green/blue components are determined. [fli_lookup_color()] @C4@i@lfli_lookup_color() @iFunction prototype int fli_lookup_color (char const *col, int *r, int *g, int *b); @iArguments char const *col: ascii-z string of color to look up int *r: pointer to int where red component will be stored int *g: pointer to int where green component will be stored int *b: pointer to int where blue component will be stored @iReturn value: 0 - color found, RGB code set 1 - color database could not be opened 2 - color not found in database [Example] @C4@i@lExample /* some color name, e.g. derived from app-defaults file */ extern char colorname []; /* RGB components of the color*/ int red, green, blue; /* hypothetical error() function to quit program, a-la printf() */ extern void error (char const *fmt, ...); register int result = fli_lookup_color (colorname, &red, &green, &blue); switch (result) { case 1: error ("failed to open RGB database %s", FLI_RGB_DATABASE); break; case 2: error ("failed to find color %s in database %s", colorname, FLI_RGB_DATABASE); break; default: /* process the color here.... */ fl_mapcolor (..............); } [Caveats] @C4@i@lCaveats @iThe RGB database file. The function fli_lookup_color() will search by default in /usr/lib/X11/rgb.txt. This name is a macro in the file fli.h (the defined name is FLI_RGB_DATABASE). You need to change this name and recompile the function if you want to use another filename. @iExact matching. The colors are matched EXACTLY as stated; i.e., with regard to upper and lower casing and with regard to spaces (if contained in the name). Possibly, an regular expression matcher might be needed but we'll cross that bridge once we get to it. xplot-1.19/libfli/lib/colormapping/ 40755 1750 1750 0 6027513770 16252 5ustar rhogeerhogeexplot-1.19/libfli/lib/colormapping/flimapnextcolor.c100644 1750 1750 1231 6027522420 21706 0ustar rhogeerhogee #include int fli_map_next_color (int r, int g, int b) { int red, green, blue; register int index; /* loop through colormap to find next free color */ for (index = 0; index <= FL_FREE_COL16; index++) { /* obtain RGB components */ fl_getmcolor (index, &red, &green, &blue); /* if equal, don't redefine */ if (red == r && green == g && blue == b) return (index); /* if unused: redefine the slot, if in free colors range */ if (index >= FL_FREE_COL1 && red == 255 && green == 255 && blue == 255) { fl_mapcolor (index, r, g, b); return (index); } } /* no more empty slots */ return (-1); } xplot-1.19/libfli/lib/colormapping/colormapping.fliman100644 1750 1750 2412 6027514730 22225 0ustar rhogeerhogee [Author] [Introduction] [fli_map_next_color()] [Example] [Caveats] [Author] @C4@i@lAuthor Karel Kubat (karel@icce.rug.nl) [Introduction] @C4@i@lIntroduction The function fli_map_next_color() works like fl_mapcolor(), except that the function first searches for an already existing color definition. If no color of the definition is found, a new color is defined in the `free color' range. [fli_map_next_color()] @C4@i@lfli_map_next_color() @iFunction prototype int fli_map_next_color (int r, int g, int b); @iArguments int r, g, b: red/green/blue components of color to map @iReturn value: >= 0 : index of mapped color < 0 : no more empty slots in color table [Example] @C4@i@lExample /* RGB components of the color*/ extern int red, green, blue; /* index of new color */ int newcol; /* hypothetical error() function to quit program, a-la printf() */ extern void error (char const *fmt, ...); if ( (newcol = fli_lookup_color (colorname, &red, &green, &blue)) < 0 ) error ("failed to define new color: out of colors"); [Caveats] @C4@i@lCaveats The function fli_map_next_color() relies on the fact that unused entries in the colormap are initially all white (255/255/255). This may vary in implementations of XForms. xplot-1.19/libfli/lib/geometry/ 40755 1750 1750 0 6031756424 15413 5ustar rhogeerhogeexplot-1.19/libfli/lib/geometry/fliparsegeometry.c100644 1750 1750 1664 6031755234 21242 0ustar rhogeerhogee #include #include #include #include int fli_parse_geometry (char const *geom, int *xp, int *yp, int *wp, int *hp) { int x, y, w, h; /* parsed width/height/x/y */ char xsign [1], ysign [1]; /* match 30x100+123+456 or - instead of + */ if (sscanf (geom, "%dx%d%1[-+]%d%1[-+]%d", &w, &h, xsign, &x, ysign, &y) == 6) { if (xsign [0] == '-') x = -x; if (ysign [0] == '-') y = -y; *wp = w; *hp = h; *xp = x; *yp = y; return (FLI_WHXY_PARSED); } /* match 30x100 */ if (sscanf (geom, "%dx%d", &w, &h) == 2) { *wp = w; *hp = h; return (FLI_WH_PARSED); } /* match +400+600 or - instead of + */ if (sscanf (geom, "%1[-+]%d%1[-+]%d", xsign, &x, ysign, &y) == 4) { if (xsign [0] == '-') x = -x; if (ysign [0] == '-') y = -y; *xp = x; *yp = y; return (FLI_XY_PARSED); } /* all failed */ return (0); } xplot-1.19/libfli/lib/geometry/fliapplygeometry.c100644 1750 1750 671 6031755234 21232 0ustar rhogeerhogee #include #include int fli_apply_geometry (FL_FORM *form, char const *geom) { int parseres, x, y, w, h; parseres = fli_parse_geometry (geom, &x, &y, &w, &h); if (parseres == FLI_WHXY_PARSED) fl_set_form_geometry (form, x, y, w, h); else if (parseres == FLI_XY_PARSED) fl_set_form_position (form, x, y); else if (parseres == FLI_WH_PARSED) fl_set_form_size (form, w, h); return (parseres); } xplot-1.19/libfli/lib/geometry/geometry.fliman100644 1750 1750 10655 6031761461 20557 0ustar rhogeerhogee [Author] [Introduction] [fli_parse_geometry()] [fli_apply_geometry()] [Example] [Introduction] @C4@i@lIntroduction The `geometry' functions of the fli library are two functions which parse a geometry string and apply it to a given form. Typically, the functions are called when a geometry string is retrieved from the commandline or from an app-defaults file. [Author] @C4@i@lAuthor Karel Kubat (karel@icce.rug.nl) [fli_parse_geometry()] @C4@i@lfli_parse_geometry() This function parses a geometry strings and returns the resulting values for the width/height and/or x-position/y-position via its arguments. The caller then typically applies the values to a form (this is what fli_apply_geometry() does). @iFunction prototype int fli_parse_geometry (char const *geom, int *x, int *y, int *w, int *h); @iArguments char const *geom: the geometry string int *x, int *y: integers to receive x/y position, when the string conforms to "+value+value" (the + can be also a -) int *w, int *h: integers to receive the width/height, when the string conforms to "valuexvalue" @iReturn value The return value is a bitmask of the following values: FLI_WH_PARSED - a width and height were parsed from the string FLI_XY_PARSED - an x and y position were parsed FLI_WHXY_PARSED - both of the above were parsed The return value is zero when neither of the above were found in the geometry string. [fli_apply_geometry()] @C4@i@lfli_apply_geometry() This function calls fli_parse_geometry() to convert a string to numeric values, and then calls the appropriate XForms functions to apply the values to a form. The caller can inspect the return value in order to determine the right argument to fl_show_form() when displaying the form. @iFunction prototype int fli_apply_geometry (FL_FORM *form, char const *geom); @iArguments FL_FORM *form: the form to which the geometry setting should be applied char const *geom: the geometry specification @iReturn value: The return value is a bitmask of the following values: FLI_WH_PARSED - a width and height were parsed from the string and applied to the form FLI_XY_PARSED - an x and y position were parsed and applied FLI_WHXY_PARSED - both of the above were parsed and applied The return value is zero when neither of the above were found in the geometry string. [Example] @C4@i@lExample Typically, you will want to parse a geometry string and apply it to a form. The result of the parsing of a string informs you whether the string contained a position definition (x/y defined), a size definition (width/height), or both. Let's assume that when no geometry is defined, you want free placing (with position and size variability). A definition in the string that states the size then results in placement where only the position is free; a string that states the position results in placement where only the size is free. A string that defines both, results in a placement where neither the size nor position are free. You'd then use the following mapping of geometry parsing vs. placement of the window: @f Geometry string parsed as.. Placing of form as.. @f ---------------------------------------------------- @f FLI_WH_PARSED FL_PLACE_SIZE @f FLI_XY_PARSED FL_PACE_POSITION @f FLI_WHXY_PARSED FL_PLACE_GEOMETRY @f neither of the above FL_PLACE_FREE This is illustrated in the following code sample: extern char geometry []; /* some geometry string */ extern FL_FORM *myform; /* some form */ int result; /* what's in the string */ /* parse the string and apply it to a form */ result = fli_apply_geometry (myform, geometry); /* now display the form */ switch (result) { case FLI_XY_PARSED: /* string defines only position */ fl_show_form (myform, FL_PLACE_POSITION, FL_FULLBORDER, "title"); break; case FLI_WH_PARSED: /* string defines width and height */ fl_show_form (myform, FL_PLACE_SIZE, FL_FULLBORDER, "title"); break; case FLI_WHXY_PARSED: fl_show_form (myform, FL_PLACE_GEOMETRY, FL_FULLBORDER, "title"); break; default: /* invalid geometry string */ fl_show_form (myform, FL_PLACE_FREE, FL_FULLBORDER, "title"); } Naturally, other examples are possible. E.g., you might always wish to allow resizing, whether an initial size was defined in a geometry string or not. In that case, you'd use FL_PLACE_POSITION even when the string parsing returns FLI_WH_PARSED. xplot-1.19/GPL100644 1750 1750 43077 6025255674 12252 0ustar rhogeerhogee GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.