Subversion Repositories wimsdev

Rev

Rev 17351 | Rev 17583 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 17351 Rev 17425
Line 5582... Line 5582...
5582
                if(onclick != 0){object_cnt++;}
5582
                if(onclick != 0){object_cnt++;}
5583
            }
5583
            }
5584
            reset();
5584
            reset();
5585
            dragstuff[20] = 1;
5585
            dragstuff[20] = 1;
5586
            if(use_dragstuff == 0 ){ use_dragstuff = 1; }
5586
            if(use_dragstuff == 0 ){ use_dragstuff = 1; }
-
 
5587
            break;
-
 
5588
 
-
 
5589
        case NEWRANGE:
-
 
5590
        /*
-
 
5591
        @ newrange xmin,xmax,ymin,ymax
-
 
5592
        @ objects defined after command will make use of this new range
-
 
5593
        @ https://wimsedu.info/?topic=dessiner-des-portions-de-fonctions-sur-un-meme-graphe
-
 
5594
        */
-
 
5595
            for(i = 0 ; i<4; i++){
-
 
5596
                switch(i){
-
 
5597
                    case 0: xmin = get_real(infile,0);break;
-
 
5598
                    case 1: xmax = get_real(infile,0);break;
-
 
5599
                    case 2: ymin = get_real(infile,0);break;
-
 
5600
                    case 3: ymax = get_real(infile,1);break;
-
 
5601
                    default: break;
-
 
5602
                }
-
 
5603
            }
-
 
5604
            string_length = 1 + snprintf(NULL,0,"\n\nxmin = %f;xmax = %f;ymin = %f;ymax = %f;\n\n",xmin,xmax,ymin,ymax);
-
 
5605
            check_string_length(string_length);tmp_buffer = my_newmem(string_length);
-
 
5606
            snprintf(tmp_buffer,string_length,"\n\nxmin = %f;xmax = %f;ymin = %f;ymax = %f;\n\n",xmin,xmax,ymin,ymax);
-
 
5607
            add_to_buffer(tmp_buffer);
5587
            break;
5608
            break;
5588
 
5609
 
5589
        case XRANGE:
5610
        case XRANGE:
5590
        /*
5611
        /*
5591
        @ xrange xmin,xmax
5612
        @ xrange xmin,xmax
Line 6289... Line 6310...
6289
  use_filled = FALSE;
6310
  use_filled = FALSE;
6290
  use_dashed = FALSE;
6311
  use_dashed = FALSE;
6291
  if(onclick != 4 ){onclick = 0;} /* slider param 'active'... onclick=4 */
6312
  if(onclick != 4 ){onclick = 0;} /* slider param 'active'... onclick=4 */
6292
  drag_type = -1;
6313
  drag_type = -1;
6293
  use_offset = 0;
6314
  use_offset = 0;
6294
 }
6315
 }
6295
}
6316
}
6296
 
6317
 
6297
char *getMML(char *tex){
6318
char *getMML(char *tex){
6298
 int my_pipe[2];pid_t pid;
6319
 int my_pipe[2];pid_t pid;
6299
 if(pipe(my_pipe)){canvas_error("mathml(): pipe() failure.\n");}
6320
 if(pipe(my_pipe)){canvas_error("mathml(): pipe() failure.\n");}
6300
  pid = fork();
6321
  pid = fork();
6301
  if (pid == (pid_t) 0){
6322
  if (pid == (pid_t) 0){
Line 6954... Line 6975...
6954
        *chemtex="chemtex",
6975
        *chemtex="chemtex",
6955
        *noreset="noreset",
6976
        *noreset="noreset",
6956
        *killreset="killreset",
6977
        *killreset="killreset",
6957
        *arrowarc="arrowarc",
6978
        *arrowarc="arrowarc",
6958
        *arcarrow="arcarrow",
6979
        *arcarrow="arcarrow",
-
 
6980
        *newrange="newrange",
6959
        *canvastype="canvastype";
6981
        *canvastype="canvastype";
6960
 
6982
 
6961
        while(((c = getc(infile)) != EOF)&&(c!='\n')&&(c!=',')&&(c!='=')&&(c!='\r')&&(c!='\t')){
6983
        while(((c = getc(infile)) != EOF)&&(c!='\n')&&(c!=',')&&(c!='=')&&(c!='\r')&&(c!='\t')){
6962
         if( i == 0 && (c == ' ') ){ continue; /* white spaces or tabs allowed before first command identifier */
6984
         if( i == 0 && (c == ' ') ){ continue; /* white spaces or tabs allowed before first command identifier */
6963
         }else{
6985
         }else{
Line 6999... Line 7021...
6999
        return TRANGE;
7021
        return TRANGE;
7000
        }
7022
        }
7001
        if( strcmp(input_type, ranget) == 0 ){
7023
        if( strcmp(input_type, ranget) == 0 ){
7002
        free(input_type);
7024
        free(input_type);
7003
        return TRANGE;
7025
        return TRANGE;
-
 
7026
        }
-
 
7027
        if( strcmp(input_type, newrange) == 0 ){
-
 
7028
        free(input_type);
-
 
7029
        return NEWRANGE;
7004
        }
7030
        }
7005
        if( strcmp(input_type, yrange) == 0 ){
7031
        if( strcmp(input_type, yrange) == 0 ){
7006
        free(input_type);
7032
        free(input_type);
7007
        return YRANGE;
7033
        return YRANGE;
7008
        }
7034
        }