periGif.c File Reference

#include <stdio.h>
#include <math.h>
#include <string.h>
#include "math_graphics.h"
#include "periGif.h"
#include "color.h"
#include "sciprint.h"
#include "../../src/gd/gd.h"
#include "bcg.h"
#include "MALLOC.h"
#include "prompt.h"
#include "Xcall1.h"
#include "periScreen.h"

Include dependency graph for periGif.c:

Go to the source code of this file.

Data Structures

struct  alinfo
struct  bgc
struct  FontInfo
struct  FontAlias

Defines

#define COLORMAP_WARNING   "Warning: with GIF and PPM drivers, the size of colormaps should be less than %d. The resulting output may be inaccurate.\n"
#define Char2Int(x)   ( x & 0x000000ff )
#define FPRINTF(x)   fprintf x
#define Thick_prec   5
#define MAXDASH   6
#define NUMSETFONC   31
#define FONTNUMBER   11
#define FONTMAXSIZE   6
#define SYMBOLNUMBER   10

Functions

char * getenv ()
void C2F() WriteGeneric1Gif ()
void C2F() xgetmarkGif (integer *verbose, integer *symb, integer *narg, double *dummy)
void C2F() xsetmarkGif (integer *number, integer *size, integer *v3, integer *v4)
void C2F() xgetfontGif (integer *verbose, integer *font, integer *nargs, double *dummy)
void C2F() xsetfontGif (integer *fontid, integer *fontsize, integer *v3, integer *v4)
void C2F() setdashstyleGif (integer *value, integer *xx, integer *n)
void C2F() Write2VectGif ()
void C2F() WriteGenericGif (char *string, integer nobj, integer sizeobj, integer *vx, integer *vy, integer sizev, integer flag, integer *fvect)
void C2F() InitScilabGCGif (integer *v1, integer *v2, integer *v3, integer *v4)
void C2F() setforegroundGif (integer *num, integer *v2, integer *v3, integer *v4)
void C2F() ScilabGCGetorSetGif (char *str, integer flag, integer *verbose, integer *x1, integer *x2, integer *x3, integer *x4, integer *x5, integer *x6, double *dx1)
void C2F() setbackgroundGif (integer *num, integer *v2, integer *v3, integer *v4)
void C2F() set_cGif (integer i)
void C2F() idfromnameGif (char *name1, integer *num)
void C2F() getdashGif (integer *verbose, integer *value, integer *narg, double *dummy)
void C2F() setscilabFigureGif (integer *v1, integer *v2, integer *v3, integer *v4, integer *v5, integer *v6, double *figure)
void C2F() getscilabFigureGif (integer *verbose, integer *x, integer *narg, double *figure)
void C2F() setscilabVersionGif (integer *vers, integer *v2, integer *v3, integer *v4)
void C2F() getscilabVersionGif (integer *verbose, integer *vers, integer *narg, double *dummy)
void C2F() setscilabxgcGif (integer *v1, integer *v2, integer *v3, integer *v4)
void C2F() getscilabxgcGif (integer *verbose, integer *x, integer *narg, double *dummy)
static void C2F() displaysymbolsGif (char *str, integer *n, integer *vx, integer *vy)
int ReadbdfFont ()
void C2F() nues1 ()
int CheckScilabXgc ()
static void FileInitGif __PARAMS ((void))
static int GifPatternColor __PARAMS ((int pat))
static void LoadFontsGif (void)
static void ColorInitGif (void)
integer GetAluGif (void)
void GetDriverName (char *DriverName)
void C2F() set_dash_or_color_Gif (integer *value, integer *v2, integer *v3, integer *v4)
void C2F() set_line_style_Gif (integer *value, integer *v2, integer *v3, integer *v4)
void C2F() get_dash_or_color_Gif (integer *verbose, integer *value, integer *narg, double *dummy)
void C2F() get_dash_and_color_Gif (integer *verbose, integer *value, integer *narg, double *dummy)
void C2F() getcolormapsizeGif (integer *v1, integer *v2, integer *v3, double *val)
void C2F() setwwhowGif (integer *verbose, integer *v2, integer *v3, integer *v4)
void C2F() DispStringAngleGif (integer *x0, integer *yy0, char *string, double *angle)
static void C2F (getcolormapGif)
void C2F() xendgraphicGif (void)
void C2F() xendGif (char *v1, integer *v2, integer *v3, integer *v4, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() clearwindowGif (char *v1, integer *v2, integer *v3, integer *v4, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() xclickGif (char *str, integer *ibutton, integer *xx1, integer *yy1, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() xclick_anyGif (char *str, integer *ibutton, integer *xx1, integer *yy1, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() xgetmouseGif (char *str, integer *ibutton, integer *xx1, integer *yy1, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() clearareaGif (char *str, integer *x, integer *y, integer *w, integer *h, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() getwindowposGif (integer *verbose, integer *x, integer *narg, double *dummy)
void C2F() setwindowposGif (integer *x, integer *y, integer *v3, integer *v4)
void C2F() getwindowdimGif (integer *verbose, integer *x, integer *narg, double *dummy)
void C2F() setwindowdimGif (integer *x, integer *y, integer *v3, integer *v4)
void C2F() setcurwinGif (integer *intnum, integer *v2, integer *v3, integer *v4)
void C2F() getcurwinGif (integer *verbose, integer *intnum, integer *narg, double *dummy)
void C2F() setclipGif (integer *x, integer *y, integer *w, integer *h)
void C2F() unsetclipGif (integer *v1, integer *v2, integer *v3, integer *v4)
void C2F() getclipGif (integer *verbose, integer *x, integer *narg, double *dummy)
void C2F() setabsourelGif (integer *num, integer *v2, integer *v3, integer *v4)
void C2F() getabsourelGif (integer *verbose, integer *num, integer *narg, double *dummy)
void C2F() setalufunctionGif (char *string)
void C2F() setalufunction1Gif (integer *num, integer *v2, integer *v3, integer *v4)
void C2F() getalufunctionGif (integer *verbose, integer *value, integer *narg, double *dummy)
void C2F() setthicknessGif (integer *value, integer *v2, integer *v3, integer *v4)
void C2F() getthicknessGif (integer *verbose, integer *value, integer *narg, double *dummy)
void C2F() setpatternGif (integer *num, integer *v2, integer *v3, integer *v4)
void C2F() getpatternGif (integer *verbose, integer *num, integer *narg, double *dummy)
void C2F() getlastGif (integer *verbose, integer *num, integer *narg, double *dummy)
void C2F() setdashGif (integer *value, integer *v2, integer *v3, integer *v4)
static int GifLineColor (void)
static int GifPatternColor (int pat)
static void C2F() set_dash_and_color_Gif (integer *value, integer *v2, integer *v3, integer *v4)
void C2F() usecolorGif (integer *num, integer *v2, integer *v3, integer *v4)
void C2F() getusecolorGif (integer *verbose, integer *num, integer *narg, double *dummy)
void setcolormapgGif (struct BCG *Xgc, integer *v1, integer *v2, double *a, integer *v3)
void C2F() setgccolormapGif (struct BCG *Xgc, integer m, double *a, integer *v3)
void C2F() setcolormapGif (integer *v1, integer *v2, integer *v3, integer *v4, integer *v5, integer *v6, double *a)
void C2F() getcolormapGif (integer *v1, integer *v2, integer *v3, double *val)
void C2F() getbackgroundGif (integer *verbose, integer *num, integer *narg, double *dummy)
void C2F() getforegroundGif (integer *verbose, integer *num, integer *narg, double *dummy)
void C2F() sethidden3dGif (integer *num, integer *v2, integer *v3, integer *v4)
void C2F() gethidden3dGif (integer *verbose, integer *num, integer *narg, double *dummy)
void C2F() semptyGif (integer *v1, integer *v2, integer *v3, integer *v4)
void C2F() gemptyGif (integer *verbose, integer *v2, integer *v3, double *dummy)
void C2F() scilabgcgetGif (char *str, integer *verbose, integer *x1, integer *x2, integer *x3, integer *x4, integer *x5, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() scilabgcsetGif (char *str, integer *x1, integer *x2, integer *x3, integer *x4, integer *x5, integer *x6, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() displaystringGif (char *string, integer *x, integer *y, integer *v1, integer *flag, integer *v6, integer *v7, double *angle, double *dv2, double *dv3, double *dv4)
void C2F() boundingboxGif (char *string, integer *x, integer *y, integer *rect, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() drawlineGif (integer *xx1, integer *yy1, integer *x2, integer *y2)
void C2F() drawsegmentsGif (char *str, integer *vx, integer *vy, integer *n, integer *style, integer *iflag, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() drawarrowsGif (char *str, integer *vx, integer *vy, integer *n, integer *as, integer *style, integer *iflag, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() drawrectanglesGif (char *str, integer *vects, integer *fillvect, integer *n, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() drawrectangleGif (char *str, integer *x, integer *y, integer *width, integer *height, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() fillrectangleGif (char *str, integer *x, integer *y, integer *width, integer *height, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() fillarcsGif (char *str, integer *vects, integer *fillvect, integer *n, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() drawarcsGif (char *str, integer *vects, integer *style, integer *n, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() drawarcGif (char *str, integer *x, integer *y, integer *width, integer *height, integer *angle1, integer *angle2, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() fillarcGif (char *str, integer *x, integer *y, integer *width, integer *height, integer *angle1, integer *angle2, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() drawpolylinesGif (char *str, integer *vectsx, integer *vectsy, integer *drawvect, integer *n, integer *p, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() fillpolylinesGif (char *str, integer *vectsx, integer *vectsy, integer *fillvect, integer *n, integer *p, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() drawpolylineGif (char *str, integer *n, integer *vx, integer *vy, integer *closeflag, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() fillpolylineGif (char *str, integer *n, integer *vx, integer *vy, integer *closeareaflag, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() drawpolymarkGif (char *str, integer *n, integer *vx, integer *vy, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() initgraphicGif (char *string, integer *v2, integer *v3, integer *v4, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
static void FileInitGif (void)
void C2F() drawaxisGif (char *str, integer *alpha, integer *nsteps, integer *v2, integer *initpoint, integer *v6, integer *v7, double *size, double *dx2, double *dx3, double *dx4)
void C2F() displaynumbersGif (char *str, integer *x, integer *y, integer *v1, integer *v2, integer *n, integer *flag, double *z, double *alpha, double *dx3, double *dx4)
void C2F() getFontMaxSizeGif (char *str, integer *sizeMin, integer *sizeMax, integer *v1, integer *v2, integer *v3, integer *v4, double *dx1, double *dx2, double *dx3, double *dx4)
void C2F() loadfamilyGif (char *name, integer *j, integer *v3, integer *v4, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() queryfamilyGif (char *name, integer *j, integer *v3, integer *v4, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
void C2F() initgraphicfromscreenGif (char *string, integer *v2, integer *v3, integer *v4, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
static void FileInitFromScreenGif (void)

Variables

static FILE * file = stdout
static double * vdouble = 0
static gdImagePtr GifIm = (gdImagePtr)0
static gdFontPtr GifFont
static int GifDashes [50]
static int nGifDashes
static int col_white
alinfo AluStrucGif []
static integer DashTabGif [MAXDASH][4]
bgc ScilabGCTabGif []
static char * sizeGif [] = { "08" ,"10","12","14","18","24"}
static int isizeGif [FONTMAXSIZE] = { 8 ,10,12,14,18,24 }
gdFont FontListGif [FONTNUMBER][FONTMAXSIZE]
FontInfo FontInfoTabGif [FONTNUMBER]
static FontAlias fonttab []
char symb_listGif []


Define Documentation

#define Char2Int ( x   )     ( x & 0x000000ff )

Definition at line 82 of file periGif.c.

#define COLORMAP_WARNING   "Warning: with GIF and PPM drivers, the size of colormaps should be less than %d. The resulting output may be inaccurate.\n"

Definition at line 79 of file periGif.c.

Referenced by FileInitFromScreenGif(), and setgccolormapGif().

#define FONTMAXSIZE   6

Definition at line 2130 of file periGif.c.

#define FONTNUMBER   11

Global variables to deal with fonts

Definition at line 2129 of file periGif.c.

#define FPRINTF ( x   )     fprintf x

Definition at line 87 of file periGif.c.

#define MAXDASH   6

to a strictly positive integer

Definition at line 676 of file periGif.c.

#define NUMSETFONC   31

Definition at line 1278 of file periGif.c.

#define SYMBOLNUMBER   10

Definition at line 2131 of file periGif.c.

#define Thick_prec   5

give the thinest line

Definition at line 591 of file periGif.c.

Referenced by setthicknessPos().


Function Documentation

static int GifPatternColor __PARAMS ( (int pat)   )  [static]

static void FileInitGif __PARAMS ( (void)   )  [static]

void C2F() boundingboxGif ( char *  string,
integer x,
integer y,
integer rect,
integer v5,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

Definition at line 1489 of file periGif.c.

References gdCharWidth(), GifFont, gdFont::h, int, sciprint(), and width.

Referenced by displaystringGif(), and xcall_in_word_set().

01490 {
01491   int k,width;
01492   if (GifIm == (gdImagePtr)0 ) {
01493     sciprint(" 14 xinit must be called before any action \r\n");
01494     return;
01495   }
01496   width = 0;
01497   for (k=0;k< (int) strlen(string);k++) 
01498     width += gdCharWidth(GifFont, string[k]);
01499   rect[0]= (int)(*x);
01500   rect[1]= (int)(*y);
01501   rect[2]= width;
01502   rect[3]= GifFont->h;
01503 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void C2F ( getcolormapGif   )  [static]

Definition at line 148 of file periGif.c.

References file, gdImageDestroy(), and GifIm.

00162         {General routines}
00163 -----------------------------------------------------*/
00164 
00167 void C2F(xselgraphicGif)(char *v1, integer *v2, integer *v3, integer *v4, integer *v5, integer *v6, integer *v7, double *dv1, double *dv2, double *dv3, double *dv4)
00168 {
00169   if (file != stdout && file != 0 ) {
00170     fclose(file);
00171     file=stdout;
00172   }
00173   if (GifIm != (gdImagePtr)0) {
00174     gdImageDestroy(GifIm);
00175     GifIm = (gdImagePtr)0;
00176   }
00177 }

Here is the call graph for this function:

int CheckScilabXgc (  ) 

Definition at line 4894 of file periWin.c.

References ScilabXgc.

Referenced by initgraphicfromscreenGif(), and initgraphicGif().

04895 {
04896   return( ScilabXgc != (struct BCG *) 0);
04897 }

Here is the caller graph for this function:

void C2F() clearareaGif ( char *  str,
integer x,
integer y,
integer w,
integer h,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

Clear a rectangle

Definition at line 256 of file periGif.c.

References x.

Referenced by xcall_in_word_set().

00257 {
00258 /*  FPRINTF((file,"\n [ %d %d %d %d ] clearzone",(int)*x,(int)*y,(int)*w,(int)*h));*/
00259 }

Here is the caller graph for this function:

void C2F() clearwindowGif ( char *  v1,
integer v2,
integer v3,
integer v4,
integer v5,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

In GIF : nothing

Sending the scale etc.. in case we want an other plot

Definition at line 224 of file periGif.c.

References gdImageFilledRectangle(), GifIm, and sciprint().

Referenced by xcall_in_word_set().

00225 {
00226 
00227   /* F.Leray : I add a rectangle with  background color*/
00228   int zero = 0;
00229   int color_white = col_index[ScilabGCGif.Numcolors+1];
00230 
00231   if (GifIm == (gdImagePtr)0 ) {
00232     sciprint(" 1 xinit must be called before any action \r\n");
00233     return;
00234   }
00235 
00236   gdImageFilledRectangle(GifIm, zero, zero,  ScilabGCGif.CWindowWidth,  ScilabGCGif.CWindowHeight,
00237                          color_white);
00238 
00240   /* FileInitGif(file); */
00241 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void ColorInitGif ( void   )  [static]

Initial (default) colormap

Definition at line 1128 of file periGif.c.

References b, C2F, col_white, default_colors, DEFAULTNUMCOLORS, g, gdImageColorAllocate(), GifIm, PI0, sciprint(), and setpatternGif().

Referenced by FileInitFromScreenGif(), FileInitGif(), and setwindowdimGif().

01129 {
01130   int m,i,r,g,b,c;
01131 
01132   if (GifIm == (gdImagePtr)0 ) {
01133     sciprint(" 11 xinit must be called before any action \r\n");
01134     return;
01135   }
01136 
01137   m = DEFAULTNUMCOLORS;
01138   ScilabGCGif.Numcolors = m;
01139   for ( i=0; i < ScilabGCGif.Numcolors; i++) {
01140     r = default_colors[3 * i];
01141     g = default_colors[3 * i + 1];
01142     b = default_colors[3 * i + 2];
01143     if (r==255&&g==255&&b==255) {
01144       /* move white a little to distinguish it from the background */
01145       r=254;g=254;b=254; }
01146     col_index[i] = gdImageColorAllocate(GifIm,r,g,b);
01147   }
01148   /* add black and white at the end of the colormap */
01149   /*c = gdImageColorExact(GifIm, 0,0,0);
01150     if (c == -1) */
01151   c = gdImageColorAllocate(GifIm,0,0,0);
01152   col_index[m]=c;
01153   /*c = gdImageColorExact(GifIm, 255,255,255);
01154     if (c == -1) */
01155   c = gdImageColorAllocate(GifIm,255,255,255);
01156   col_index[m+1]=c;
01157   col_white=col_index[m+1];
01158   ScilabGCGif.NumForeground = m;
01159   ScilabGCGif.NumBackground = m + 1;
01160   C2F(setpatternGif)((i=ScilabGCGif.NumForeground+1,&i),PI0,PI0,PI0); 
01161   if (ScilabGCGif.CurColorStatus == 1) 
01162     {
01163       ScilabGCGif.IDLastPattern = ScilabGCGif.Numcolors - 1;
01164     }
01165 
01166 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() displaynumbersGif ( char *  str,
integer x,
integer y,
integer v1,
integer v2,
integer n,
integer flag,
double *  z,
double *  alpha,
double *  dx3,
double *  dx4 
)

Definition at line 2117 of file periGif.c.

References buf, C2F, and displaystringGif().

Referenced by xcall_in_word_set().

02118 { integer i ;
02119   char buf[20];
02120   for (i=0 ; i< *n ; i++)
02121     { 
02122       sprintf(buf,ScilabGCGif.CurNumberDispFormat,z[i]);
02123       C2F(displaystringGif)(buf,&(x[i]),&(y[i]),PI0,flag,PI0,PI0,&(alpha[i]),PD0,PD0,PD0) ;
02124     }
02125 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() displaystringGif ( char *  string,
integer x,
integer y,
integer v1,
integer flag,
integer v6,
integer v7,
double *  angle,
double *  dv2,
double *  dv3,
double *  dv4 
)

Definition at line 1453 of file periGif.c.

References Abs, boundingboxGif(), C2F, DispStringAngleGif(), gdImageString(), gdImageStringUp(), getdashGif(), GifFont, GifLineColor(), sciprint(), setdashGif(), and vdouble.

Referenced by displaynumbersGif(), and xcall_in_word_set().

01454 {     
01455   integer rect[4] ;
01456   integer boxX = 0 ;
01457   integer boxY = 0 ;
01458 
01459   integer verbose, Dnarg,Dvalue[10],j;
01460   verbose =0 ;
01461   if (GifIm == (gdImagePtr)0 ) {
01462     sciprint(" 13 xinit must be called before any action \r\n");
01463     return;
01464   }
01465   if ( Abs(*angle) <= 0.1) {
01466     C2F(boundingboxGif)(string,&boxX,&boxY,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0);
01467     C2F(getdashGif)(&verbose,Dvalue,&Dnarg,vdouble);
01468     C2F(setdashGif)((j=1,&j),PI0,PI0,PI0);
01469     gdImageString(GifIm, GifFont, *x, *y - rect[3], (unsigned char*) string,
01470                   GifLineColor());
01471     C2F(setdashGif)(Dvalue,PI0,PI0,PI0);
01472   }
01473   else if ( Abs(*angle + 90) <= 0.1 )   /* added by Bruno */
01474     {
01475     C2F(boundingboxGif)(string,&boxX,&boxY,rect,PI0,PI0,PI0,PD0,PD0,PD0,PD0);
01476     C2F(getdashGif)(&verbose,Dvalue,&Dnarg,vdouble);
01477     C2F(setdashGif)((j=1,&j),PI0,PI0,PI0);
01478     /* a voir (peut etre enlever le -rect[2] qui doit centrer en vertical alors
01479        que ce n'est pas attendu) */
01480     gdImageStringUp(GifIm, GifFont, *x - rect[3], *y - rect[2], (unsigned char*) string,
01481                   GifLineColor());
01482     C2F(setdashGif)(Dvalue,PI0,PI0,PI0);
01483     }
01484   else 
01485     C2F(DispStringAngleGif)(x,y,string,angle);
01486 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void C2F() displaysymbolsGif ( char *  str,
integer n,
integer vx,
integer vy 
) [static]

Referenced by drawpolymarkGif().

Here is the caller graph for this function:

void C2F() DispStringAngleGif ( integer x0,
integer yy0,
char *  string,
double *  angle 
)

Referenced by displaystringGif().

Here is the caller graph for this function:

void C2F() drawarcGif ( char *  str,
integer x,
integer y,
integer width,
integer height,
integer angle1,
integer angle2,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

caution angle=degreAngle*64

Definition at line 1739 of file periGif.c.

References alpha, C2F, close(), drawpolylineGif(), fact(), Min, and sciprint().

Referenced by drawarcsGif(), and xcall_in_word_set().

01740 { 
01741   integer vx[365],vy[365],k,n;
01742   float alpha,fact= (float) 0.01745329251994330,w,h;
01743   integer close = 0;
01744 
01745   if (GifIm == (gdImagePtr)0 ) {
01746     sciprint(" 23 xinit must be called before any action \r\n");
01747     return;
01748   }
01749 
01750   w = (float) ((*width)/2.0);
01751   h = (float) ((*height)/2.0);
01752   n=Min((*angle2/64),360);
01753   for (k = 0; k < n; ++k) {
01754     alpha=((*angle1/64)+k)*fact;
01755     vx[k] = (integer) (*x + w*(cos(alpha)+1.0));
01756     vy[k] = (integer) (*y + h*(-sin(alpha)+1.0));}
01757   
01758   /* Fix bug 1737 : if n==360 we want a closed circle */
01759   if(n == 360) close = 1;
01760   
01761   C2F(drawpolylineGif)(str, &n, vx, vy, &close, PI0, PI0, dv1, dv2, dv3, dv4);
01762 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() drawarcsGif ( char *  str,
integer vects,
integer style,
integer n,
integer v5,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

caution : angle=degreangle*64

to fix the style

Definition at line 1712 of file periGif.c.

References C2F, drawarcGif(), get_dash_and_color_Gif(), sciprint(), set_dash_and_color_Gif(), set_line_style_Gif(), and vdouble.

Referenced by xcall_in_word_set().

01713 {
01714   integer verbose=0,Dnarg,Dvalue[10],NDvalue;
01715   int i,i6;
01716 
01717   if (GifIm == (gdImagePtr)0 ) {
01718     sciprint(" 22 xinit must be called before any action \r\n");
01719     return;
01720   }
01721   /* store the current values */
01722   C2F(get_dash_and_color_Gif)(&verbose,Dvalue,&Dnarg,vdouble);
01723   for ( i=0 ; i < *n ; i++) 
01724     {
01726       NDvalue = style[i];
01727       C2F(set_line_style_Gif)(&NDvalue,PI0,PI0,PI0);
01728       i6=6*i;
01729       C2F(drawarcGif)(str,vects+i6,vects+(i6+1),vects+(i6+2),vects+(i6+3),
01730                       vects+(i6+4),vects+(i6+5) , dv1, dv2, dv3, dv4);
01731     }
01732   C2F(set_dash_and_color_Gif)( Dvalue,PI0,PI0,PI0);
01733 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() drawarrowsGif ( char *  str,
integer vx,
integer vy,
integer n,
integer as,
integer style,
integer iflag,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

as is 10*arsize (arsize) the size of the arrow head in pixels

Definition at line 1568 of file periGif.c.

References Abs, C2F, dx, dy, fillpolylinesGif(), gdImageThickLine(), get_dash_and_color_Gif(), GifLineColor(), inint, M_PI, Max, p, sciprint(), set_dash_and_color_Gif(), set_line_style_Gif(), SMDOUBLE, and vdouble.

Referenced by xcall_in_word_set().

01569 { 
01570   integer verbose=0,Dnarg,Dvalue[10],NDvalue,i;
01571   double cos20=cos(20.0*M_PI/180.0);
01572   double sin20=sin(20.0*M_PI/180.0);
01573   integer polyx[4],polyy[4]; 
01574 
01575   if (GifIm == (gdImagePtr)0 ) {
01576     sciprint(" 17 xinit must be called before any action \r\n");
01577     return;
01578   }
01579 
01580   C2F(get_dash_and_color_Gif)(&verbose,Dvalue,&Dnarg,vdouble);
01581   for (i=0 ; i < *n/2 ; i++)
01582     { 
01583       double dx,dy,norm;
01584       if ( (int) *iflag == 1) 
01585         NDvalue = style[i];
01586       else 
01587         NDvalue=(*style < 1) ?  Dvalue[0] : *style;
01588       C2F(set_line_style_Gif)(&NDvalue,PI0,PI0,PI0);
01589 
01590      dx=( vx[2*i+1]-vx[2*i]);
01591       dy=( vy[2*i+1]-vy[2*i]);
01592       norm = sqrt(dx*dx+dy*dy);
01593       if ( Abs(norm) >  SMDOUBLE ) 
01594         { integer nn=1,p=3;
01595           dx=(*as/10.0)*dx/norm;dy=(*as/10.0)*dy/norm;
01596           polyx[0]= polyx[3]=vx[2*i+1];/* correction bug 607 (bruno 18 nov 2004) */
01597           polyx[1]= inint(polyx[0]  - cos20*dx -sin20*dy );
01598           polyx[2]= inint(polyx[0]  - cos20*dx + sin20*dy);
01599           polyy[0]= polyy[3]=vy[2*i+1];/* correction bug 607 (bruno 18 nov 2004) */
01600           polyy[1]= inint(polyy[0] + sin20*dx -cos20*dy) ;
01601           polyy[2]= inint(polyy[0] - sin20*dx - cos20*dy) ;
01602           C2F(fillpolylinesGif)("v",polyx,polyy,&NDvalue, &nn,&p,PI0,PD0,PD0,PD0,PD0);
01603           }
01604 
01605       gdImageThickLine(GifIm, vx[2*i], vy[2*i],(int)
01606                        (vx[2*i + 1]-dx*cos20), (int)(vy[2*i + 1]-dy*cos20),
01607                        GifLineColor(),Max(1,ScilabGCGif.CurLineWidth));
01608  
01609     }
01610   C2F(set_dash_and_color_Gif)( Dvalue,PI0,PI0,PI0);
01611 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() drawaxisGif ( char *  str,
integer alpha,
integer nsteps,
integer v2,
integer initpoint,
integer v6,
integer v7,
double *  size,
double *  dx2,
double *  dx3,
double *  dx4 
)

Definition at line 2073 of file periGif.c.

References gdImageThickLine(), GifLineColor(), inint, M_PI, Max, sciprint(), xi, and yi.

Referenced by xcall_in_word_set().

02074 { integer i;
02075   double xi,yi,xf,yf;
02076   double cosal,sinal;
02077 
02078   if (GifIm == (gdImagePtr)0 ) {
02079     sciprint(" 29 xinit must be called before any action \r\n");
02080     return;
02081   }
02082   cosal= cos( (double)M_PI * (*alpha)/180.0);
02083   sinal= sin( (double)M_PI * (*alpha)/180.0);
02084   for (i=0; i <= nsteps[0]*nsteps[1]; i++)
02085     {
02086       if (( i % nsteps[0]) != 0)
02087         {
02088           xi = initpoint[0]+i*size[0]*cosal;
02089           yi = initpoint[1]+i*size[0]*sinal;
02090           xf = xi - ( size[1]*sinal);
02091           yf = yi + ( size[1]*cosal);
02092           gdImageThickLine(GifIm,inint(xi),inint(yi),inint(xf),inint(yf), 
02093                       GifLineColor(),Max(1,ScilabGCGif.CurLineWidth));
02094         }
02095     }
02096   for (i=0; i <= nsteps[1]; i++)
02097     { xi = initpoint[0]+i*nsteps[0]*size[0]*cosal;
02098       yi = initpoint[1]+i*nsteps[0]*size[0]*sinal;
02099       xf = xi - ( size[1]*size[2]*sinal);
02100       yf = yi + ( size[1]*size[2]*cosal);
02101       gdImageThickLine(GifIm,inint(xi),inint(yi),inint(xf),inint(yf), 
02102                   GifLineColor(),Max(1,ScilabGCGif.CurLineWidth));
02103     }
02104 
02105   xi = initpoint[0]; yi= initpoint[1];
02106   xf = initpoint[0]+ nsteps[0]*nsteps[1]*size[0]*cosal;
02107   yf = initpoint[1]+ nsteps[0]*nsteps[1]*size[0]*sinal;
02108   gdImageThickLine(GifIm, inint(xi),inint(yi),inint(xf),inint(yf),
02109               GifLineColor(),Max(1,ScilabGCGif.CurLineWidth));
02110 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() drawlineGif ( integer xx1,
integer yy1,
integer x2,
integer y2 
)

Draw a single line in current style

Definition at line 1507 of file periGif.c.

References gdImageThickLine(), GifLineColor(), Max, and sciprint().

01508 {
01509   if (GifIm == (gdImagePtr)0 ) {
01510     sciprint(" 15 xinit must be called before any action \r\n");
01511     return;
01512   }
01513   gdImageThickLine(GifIm, *xx1, *yy1, *x2, *y2, GifLineColor(),
01514                    Max(1,ScilabGCGif.CurLineWidth));
01515 }

Here is the call graph for this function:

void C2F() drawpolylineGif ( char *  str,
integer n,
integer vx,
integer vy,
integer closeflag,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

according to *closeflag : it's a polyline or a polygon

Definition at line 1898 of file periGif.c.

References gdImagePolyLine(), GifLineColor(), Max, n1, and sciprint().

Referenced by drawarcGif(), drawpolylinesGif(), and xcall_in_word_set().

01899 {
01900   integer thick,n1;
01901   if (GifIm == (gdImagePtr)0 ) {
01902     sciprint(" 27 xinit must be called before any action \r\n");
01903     return;
01904   }
01905   thick = Max(1,ScilabGCGif.CurLineWidth);
01906   n1 = *n;
01907   gdImagePolyLine(GifIm,vx,vy,n1,GifLineColor(),thick,*closeflag);
01908 
01909 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() drawpolylinesGif ( char *  str,
integer vectsx,
integer vectsy,
integer drawvect,
integer n,
integer p,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

drawvect[i] < 0 use a line style for polyline i

on utilise la marque de numero associ\'ee

on utilise un style pointill\'e

back to default values

Definition at line 1811 of file periGif.c.

References C2F, close(), drawpolylineGif(), drawpolymarkGif(), get_dash_and_color_Gif(), sciprint(), set_dash_and_color_Gif(), set_line_style_Gif(), setdashGif(), vdouble, xgetmarkGif(), and xsetmarkGif().

Referenced by xcall_in_word_set().

01812 { integer verbose ,symb[2],Mnarg,Dnarg,Dvalue[10],NDvalue,i,j,close;
01813   verbose =0 ;
01814   if (GifIm == (gdImagePtr)0 ) {
01815     sciprint(" 25 xinit must be called before any action \r\n");
01816     return;
01817   }
01818   /* store the current values */
01819   C2F(xgetmarkGif)(&verbose,symb,&Mnarg,vdouble);
01820   C2F(get_dash_and_color_Gif)(&verbose,Dvalue,&Dnarg,vdouble);
01821   for (i=0 ; i< *n ; i++)
01822     {
01823       if (drawvect[i] <= 0)
01824         { 
01825           NDvalue = - drawvect[i];
01826           C2F(setdashGif)((j=1,&j),PI0,PI0,PI0);
01827 
01828           C2F(xsetmarkGif)(&NDvalue,symb+1,PI0,PI0);
01829           
01830           C2F(drawpolymarkGif)(str,p,vectsx+(*p)*i,vectsy+(*p)*i,PI0,PI0,PI0,PD0,PD0,PD0,PD0);
01831           C2F(setdashGif)(Dvalue,PI0,PI0,PI0);
01832         }
01833       else
01834         {
01836           C2F(set_line_style_Gif)(drawvect+i,PI0,PI0,PI0);
01837           close = 0;
01838           C2F(drawpolylineGif)(str,p,vectsx+(*p)*i,vectsy+(*p)*i,&close,PI0,PI0,PD0,PD0,PD0,PD0);
01839         }
01840     }
01842   C2F(set_dash_and_color_Gif)(Dvalue,PI0,PI0,PI0);
01843   C2F(xsetmarkGif)(symb,symb+1,PI0,PI0);
01844 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() drawpolymarkGif ( char *  str,
integer n,
integer vx,
integer vy,
integer v5,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

by vx and vy (vx[i],vy[i])

Definition at line 1931 of file periGif.c.

References C2F, displaysymbolsGif(), sz, and xsetfontGif().

Referenced by drawpolylinesGif(), and xcall_in_word_set().

01932 { 
01933   integer keepid,keepsize,i=1,sz=ScilabGCGif.CurHardSymbSize;
01934 
01935   keepid =  ScilabGCGif.FontId;
01936   keepsize= ScilabGCGif.FontSize;
01937   C2F(xsetfontGif)(&i,&sz,PI0,PI0);
01938   C2F(displaysymbolsGif)(str,n,vx,vy);
01939   C2F(xsetfontGif)(&keepid,&keepsize,PI0,PI0);
01940 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() drawrectangleGif ( char *  str,
integer x,
integer y,
integer width,
integer height,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

Definition at line 1653 of file periGif.c.

References gdImageRectangle(), GifLineColor(), and sciprint().

Referenced by xcall_in_word_set().

01654 {
01655   if (GifIm == (gdImagePtr)0 ) {
01656     sciprint(" 19 xinit must be called before any action \r\n");
01657     return;
01658   }
01659   gdImageRectangle(GifIm, *x, *y, *x + *width, *y + *height, GifLineColor());
01660 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() drawrectanglesGif ( char *  str,
integer vects,
integer fillvect,
integer n,
integer v5,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

fillvect[*n] : specify the action (see periX11.c)

Definition at line 1622 of file periGif.c.

References abs, C2F, gdImageFilledRectangle(), gdImageThickRectangle(), get_dash_and_color_Gif(), getpatternGif(), GifLineColor(), GifPatternColor(), Max, sciprint(), set_dash_and_color_Gif(), set_line_style_Gif(), and vdouble.

Referenced by xcall_in_word_set().

01623 {
01624   int i,cpat,verb=0,num,cd[10],thick;
01625 
01626   if (GifIm == (gdImagePtr)0 ) {
01627     sciprint(" 18 xinit must be called before any action \r\n");
01628     return;
01629   }
01630   C2F(getpatternGif)(&verb,&cpat,&num,vdouble);
01631   C2F(get_dash_and_color_Gif)(&verb,cd,&num,vdouble);
01632   thick = Max(1,ScilabGCGif.CurLineWidth);
01633   for (i = 0; i < *n; i++) {
01634     int x, y, w, h;
01635     x = vects[4 * i];
01636     y = vects[4 * i + 1];
01637     w = vects[4 * i + 2];
01638     h = vects[4 * i + 3];
01639     if ( fillvect[i] < 0 ) {
01640       int dash = - fillvect[i];
01641       C2F(set_line_style_Gif)(&dash,PI0,PI0,PI0);
01642       gdImageThickRectangle(GifIm, x, y, x + w, y + h, GifLineColor(),thick);
01643     }
01644     else if ( fillvect[i] == 0 ) 
01645       gdImageThickRectangle(GifIm, x, y, x + w, y + h, GifLineColor(),thick);
01646     else
01647       gdImageFilledRectangle(GifIm, x, y, x + w, y + h,
01648                              GifPatternColor(abs(fillvect[i])));
01649   }
01650   C2F(set_dash_and_color_Gif)(cd,PI0,PI0,PI0);
01651 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() drawsegmentsGif ( char *  str,
integer vx,
integer vy,
integer n,
integer style,
integer iflag,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

for i=0 step 2

all segments have the same color or dash style

Definition at line 1521 of file periGif.c.

References C2F, gdImageThickLine(), get_dash_and_color_Gif(), GifLineColor(), Max, sciprint(), set_dash_and_color_Gif(), set_dash_or_color_Gif(), setpatternGif(), and vdouble.

Referenced by xcall_in_word_set().

01522 {
01523   integer verbose=0,Dnarg,Dvalue[10],NDvalue;
01524   int i;
01525   if (GifIm == (gdImagePtr)0 ) {
01526     sciprint(" 16 xinit must be called before any action \r\n");
01527     return;
01528   }
01529 
01530 
01531   /* store the current values */
01532 
01533 
01534   C2F(get_dash_and_color_Gif)(&verbose,Dvalue,&Dnarg,vdouble);
01535   if ((int)  *iflag == 0 )
01536     {
01539       NDvalue= (*style < 1) ? Dvalue[0] : *style;
01540       C2F(set_dash_or_color_Gif)(&NDvalue,PI0,PI0,PI0);
01541       for ( i=0 ; i < *n/2 ; i++) {
01542           gdImageThickLine(GifIm, vx[2*i], vy[2*i],
01543                            vx[2*i + 1], vy[2*i + 1],
01544                            GifLineColor(),Max(1,ScilabGCGif.CurLineWidth));
01545       }
01546     }
01547   else
01548     {
01549       for ( i=0 ; i < *n/2 ; i++) 
01550         {
01551           integer NDvalue2;
01552           NDvalue2 = style[i];
01553           C2F(setpatternGif)(&NDvalue2,PI0,PI0,PI0);
01554           gdImageThickLine(GifIm, vx[2*i], vy[2*i],
01555                            vx[2*i + 1], vy[2*i + 1],
01556                            GifLineColor(),Max(1,ScilabGCGif.CurLineWidth));
01557         }
01558     }
01559   C2F(set_dash_and_color_Gif)( Dvalue,PI0,PI0,PI0);
01560 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void FileInitFromScreenGif ( void   )  [static]

Definition at line 2454 of file periGif.c.

References B, b, C2F, CheckColormap(), col_white, ColorInitGif(), COLORMAP_WARNING, FREE, G, g, gdImageColorAllocate(), gdImageColorDeallocate(), gdMaxColors, get_b(), get_g(), get_r(), i1, ierr, ind, InitScilabGCGif(), int, m1, MALLOC, nues1(), NULL, R, sciprint(), setpatternGif(), and vdouble.

Referenced by initgraphicfromscreenGif().

02455 {
02456   int m,r,g,b,c,i;
02457   float R,G,B;
02458   double *bigcmap,*cmap;
02459   int *ind,m1,ierr,i1;
02460 
02461   integer x[2],verbose,narg;
02462 
02463   verbose = 0; 
02464   C2F(getwindowdimGif)(&verbose,x,&narg,vdouble);
02465   ColorInitGif();
02466   InitScilabGCGif(PI0,PI0,PI0,PI0);
02467   
02468   if (  CheckColormap(&m) == 1) { /* a previously defined colormap */
02469 
02470     /* deallocate old colors*/
02471     for ( i=0; i < GifIm->colorsTotal; i++) 
02472       gdImageColorDeallocate(GifIm, i);
02473     for ( i=0;i < ScilabGCGif.Numcolors+2; i++) 
02474       col_index[i] = -1;
02475 
02476     if (m>gdMaxColors-3) {/* reduce the number of colors */
02477       sciprint(COLORMAP_WARNING,gdMaxColors-2) ;
02478       if ( (bigcmap = (double*) MALLOC(3*m * sizeof(double)))== NULL) {
02479         sciprint("Not enough memory\n");
02480         return;
02481       }
02482       for ( i=0; i < m; i++) { /* get the previously defined colormap */
02483         get_r(i,&R);
02484         get_g(i,&G);
02485         get_b(i,&B);
02486         bigcmap[i] = R;
02487         bigcmap[i + m] = G;
02488         bigcmap[i + 2 * m] = B;
02489       }
02490       m1 = gdMaxColors-2;
02491       if ( (cmap = (double*) MALLOC(3*m1 * sizeof(double)))== NULL) {
02492         sciprint("Not enough memory\n");
02493         FREE(bigcmap);
02494         return;
02495       }
02496       if ( (ind = (int*) MALLOC(m * sizeof(int)))== NULL) {
02497         sciprint("Not enough memory\n");
02498         FREE(bigcmap);
02499         FREE(cmap);
02500         return;
02501       }
02502 
02503       C2F(nues1)(bigcmap,&m,cmap,&m1,ind,&ierr); /* compute new colormap */
02504       /* create new colormap */
02505       ScilabGCGif.Numcolors = m;
02506       for ( i=0; i < ScilabGCGif.Numcolors; i++) {
02507         i1 = ind[i] - 1;
02508         r=(int)(cmap[i1] * 255);
02509         g=(int)(cmap[i1 + m1] * 255);
02510         b=(int)(cmap[i1 + 2 * m1] * 255);
02511         if (r==255&&g==255&&b==255) {
02512           /* move white a little to distinguish it from the background */
02513           r=254;g=254;b=254; }
02514         /*      c = gdImageColorExact(GifIm, r,g,b);
02515                 if (c == -1)*/
02516         c = gdImageColorAllocate(GifIm,r,g,b);
02517         col_index[i] = c;
02518       }
02519       FREE(ind);
02520       FREE(cmap);
02521       FREE(bigcmap);
02522     }
02523     else {
02524       /* create new color map */
02525       ScilabGCGif.Numcolors = m;
02526       for ( i=0; i < ScilabGCGif.Numcolors; i++) {
02527         get_r(i,&R);
02528         get_g(i,&G);
02529         get_b(i,&B);
02530         r = (int)(R*255);
02531         g = (int)(G*255);
02532         b = (int)(B*255);
02533         /*c = gdImageColorExact(GifIm, r,g,b);
02534           if (c == -1)*/
02535         c = gdImageColorAllocate(GifIm,r,g,b);
02536         col_index[i] = c;
02537       }
02538     }
02539     /* add black and white at the end of the colormap */
02540     /*c = gdImageColorExact(GifIm, 0,0,0);
02541       if (c == -1) */
02542       c = gdImageColorAllocate(GifIm,0,0,0);
02543     col_index[m]=c;
02544     /*c = gdImageColorExact(GifIm, 255,255,255);
02545       if (c == -1) */
02546     c = gdImageColorAllocate(GifIm,255,255,255);
02547     col_index[m+1]=c;
02548     col_white=col_index[m+1];
02549     ScilabGCGif.NumForeground = m;
02550     ScilabGCGif.NumBackground = m + 1;
02551   }
02552   C2F(setpatternGif)((i=ScilabGCGif.NumForeground+1,&i),PI0,PI0,PI0); 
02553   if (ScilabGCGif.CurColorStatus == 1) 
02554     {
02555       ScilabGCGif.IDLastPattern = ScilabGCGif.Numcolors - 1;
02556     }
02557 
02558 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void FileInitGif ( void   )  [static]

Definition at line 1987 of file periGif.c.

References C2F, ColorInitGif(), InitScilabGCGif(), setpatternGif(), and vdouble.

Referenced by initgraphicGif().

01988 {
01989 
01990   int i;
01991   integer x[2],verbose,narg;
01992 
01993   verbose = 0; 
01994   C2F(getwindowdimGif)(&verbose,x,&narg,vdouble);
01995   ColorInitGif();
01996   InitScilabGCGif(PI0,PI0,PI0,PI0);
01997 
01998   C2F(setpatternGif)((i=ScilabGCGif.NumForeground+1,&i),PI0,PI0,PI0); 
01999   if (ScilabGCGif.CurColorStatus == 1) 
02000     {
02001       ScilabGCGif.IDLastPattern = ScilabGCGif.Numcolors - 1;
02002     }
02003 
02004 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() fillarcGif ( char *  str,
integer x,
integer y,
integer width,
integer height,
integer angle1,
integer angle2,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

with current pattern

Definition at line 1767 of file periGif.c.

References alpha, C2F, close(), fact(), fillpolylineGif(), Min, and sciprint().

Referenced by fillarcsGif(), and xcall_in_word_set().

01768 { 
01769   integer vx[365],vy[365],k,k0,kmax,n;
01770   float alpha,fact= (float) 0.01745329251994330,w,h;
01771   integer close = 1;
01772   if (GifIm == (gdImagePtr)0 ) {
01773     sciprint(" 24 xinit must be called before any action \r\n");
01774     return;
01775   }
01776   n=Min((*angle2/64),360);
01777 
01778   w = (float) ((*width)/2.0);
01779   h = (float) ((*height)/2.0);
01780   k0 = 0;
01781   kmax = n-1;
01782 
01783   if (n != 360) {
01784   vx[0] =  (integer) (*x + w);
01785   vy[0] =  (integer) (*y + h);
01786   k0 = 1;
01787   kmax = n;}
01788 
01789   for (k = k0; k <= kmax; ++k) {
01790     alpha=((*angle1/64)+k)*fact;
01791     vx[k] =  (integer) (*x + w*(cos(alpha)+1.0));
01792     vy[k] =  (integer) (*y + h*(-sin(alpha)+1.0));}
01793   if (n != 360) {
01794   n++;
01795   vx[n] = (integer) (*x + ((*width)/2.0));
01796   vy[n] = (integer) (*y + ((*height)/2.0)); 
01797   n++;
01798   }
01799   C2F(fillpolylineGif)(str, &n, vx, vy, &close, PI0, PI0, dv1, dv2, dv3, dv4);
01800  }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() fillarcsGif ( char *  str,
integer vects,
integer fillvect,
integer n,
integer v5,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

caution angle=degreangle*64

to fix the style

Definition at line 1682 of file periGif.c.

References C2F, fillarcGif(), getpatternGif(), sciprint(), setpatternGif(), and vdouble.

Referenced by xcall_in_word_set().

01683 {
01684   integer verbose=0,Dnarg,pat;
01685   int i,i6;
01686 
01687   if (GifIm == (gdImagePtr)0 ) {
01688     sciprint(" 21 xinit must be called before any action \r\n");
01689     return;
01690   }
01691   /* store the current values */
01692   C2F(getpatternGif)(&verbose,&pat,&Dnarg,vdouble);
01693   for ( i=0 ; i < *n ; i++) 
01694     {
01696       C2F(setpatternGif)(&fillvect[i],PI0,PI0,PI0);
01697       i6=6*i;
01698       C2F(fillarcGif)(str,&(vects[i6]),&(vects[i6+1]),&(vects[i6+2]),
01699                       &(vects[i6+3]),&(vects[i6+4]),&(vects[i6+5]) ,dv1, dv2, dv3, dv4);
01700 
01701     }
01702   C2F(setpatternGif)(&pat,PI0,PI0,PI0);
01703 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() fillpolylineGif ( char *  str,
integer n,
integer vx,
integer vy,
integer closeareaflag,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

Fill the polygon

just fill ==> cpat < 0

Definition at line 1913 of file periGif.c.

References C2F, fillpolylinesGif(), getpatternGif(), sciprint(), and vdouble.

Referenced by fillarcGif(), and xcall_in_word_set().

01914 {
01915   integer i =1;
01916   integer cpat,verb=0,num;
01917   if (GifIm == (gdImagePtr)0 ) {
01918     sciprint(" 28 xinit must be called before any action \r\n");
01919     return;
01920   }
01921   C2F(getpatternGif)(&verb,&cpat,&num,vdouble); 
01923   cpat = -cpat;
01924   fillpolylines_closeflag = *closeareaflag;
01925   C2F(fillpolylinesGif)(str,vx,vy,&cpat,&i,n,PI0,PD0,PD0,PD0,PD0);
01926 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() fillpolylinesGif ( char *  str,
integer vectsx,
integer vectsy,
integer fillvect,
integer n,
integer p,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

Definition at line 1857 of file periGif.c.

References abs, FREE, gdImageFilledPolygon(), gdImagePolyLine(), GifLineColor(), GifPatternColor(), MALLOC, Max, n1, NULL, points, and sciprint().

Referenced by drawarrowsGif(), fillpolylineGif(), and xcall_in_word_set().

01858 {
01859   integer n1,i,j,o;
01860 
01861   gdPoint *points;
01862   integer c,thick;
01863   if (GifIm == (gdImagePtr)0 ) {
01864     sciprint(" 26 xinit must be called before any action \r\n");
01865     return;
01866   }
01867   n1 = *p;
01868   if (fillpolylines_closeflag) n1++;
01869   points = (gdPoint*) MALLOC(n1 * sizeof(gdPoint));
01870   if (points == (gdPoint*) NULL) return;
01871   for (j = 0; j < *n; j++) {
01872       o = j * (*p);
01873       for (i = 0; i < *p; i++) {
01874           points[i].x = vectsx[o + i];
01875           points[i].y = vectsy[o + i];
01876       }
01877       if (fillpolylines_closeflag) {
01878           points[*p].x = vectsx[o];
01879           points[*p].y = vectsy[o];
01880       }
01881       if (fillvect[j] != 0) {
01882         gdImageFilledPolygon(GifIm, points, n1,
01883                              GifPatternColor(abs(fillvect[j])));
01884       }
01885       if (fillvect[j] >= 0) {
01886         c = GifLineColor();
01887         thick = Max(1,ScilabGCGif.CurLineWidth);
01888         gdImagePolyLine(GifIm, &(vectsx[o]), &(vectsy[o]),
01889                         *p,c,thick,fillpolylines_closeflag);
01890       }
01891   }
01892   FREE(points);
01893 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() fillrectangleGif ( char *  str,
integer x,
integer y,
integer width,
integer height,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

Draw a filled rectangle

Definition at line 1664 of file periGif.c.

References C2F, gdImageFilledRectangle(), getpatternGif(), GifPatternColor(), sciprint(), and vdouble.

Referenced by xcall_in_word_set().

01665 { 
01666 
01667   integer cpat,verb=0,num;
01668 
01669   if (GifIm == (gdImagePtr)0 ) {
01670     sciprint(" 20 xinit must be called before any action \r\n");
01671     return;
01672   }
01673   C2F(getpatternGif)(&verb,&cpat,&num,vdouble);
01674   gdImageFilledRectangle(GifIm, *x, *y, *x + *width, *y + *height,
01675                          GifPatternColor(cpat));
01676 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() gemptyGif ( integer verbose,
integer v2,
integer v3,
double *  dummy 
)

Definition at line 1273 of file periGif.c.

References sciprint().

01274 {
01275   if ( *verbose ==1 ) sciprint("\n No operation ");
01276 }

Here is the call graph for this function:

void C2F() get_dash_and_color_Gif ( integer verbose,
integer value,
integer narg,
double *  dummy 
)

Referenced by drawarcsGif(), drawarrowsGif(), drawpolylinesGif(), drawrectanglesGif(), and drawsegmentsGif().

Here is the caller graph for this function:

void C2F() get_dash_or_color_Gif ( integer verbose,
integer value,
integer narg,
double *  dummy 
)

to get the current dash-style

void C2F() getabsourelGif ( integer verbose,
integer num,
integer narg,
double *  dummy 
)

to get information on absolute or relative mode

Definition at line 486 of file periGif.c.

References CoordModeOrigin, and sciprint().

00487 {
00488   *narg = 1;
00489   *num = ScilabGCGif.CurVectorStyle  ;
00490   if (*verbose == 1) 
00491     {
00492       if (ScilabGCGif.CurVectorStyle == CoordModeOrigin)
00493         sciprint("\nTrace Absolu");
00494       else 
00495         sciprint("\nTrace Relatif");
00496     }
00497 }

Here is the call graph for this function:

void C2F() getalufunctionGif ( integer verbose,
integer value,
integer narg,
double *  dummy 
)

To get the value of the alufunction

Definition at line 574 of file periGif.c.

References AluStrucGif, info, and sciprint().

00575 { 
00576   *narg =1 ;
00577   *value = ScilabGCGif.CurDrawFunction ;
00578    if (*verbose ==1 ) 
00579      { sciprint("\nThe Alufunction is %s -> <%s>\r\n",
00580                AluStrucGif[*value].name,
00581                AluStrucGif[*value].info);}
00582  }

Here is the call graph for this function:

integer GetAluGif ( void   ) 

Definition at line 584 of file periGif.c.

00585 {
00586 return ScilabGCGif.CurDrawFunction;
00587 }

void C2F() getbackgroundGif ( integer verbose,
integer num,
integer narg,
double *  dummy 
)

Definition at line 1187 of file periGif.c.

References sciprint().

01188 { 
01189   *narg=1;
01190   if ( ScilabGCGif.CurColorStatus == 1 ) 
01191     {
01192       *num = ScilabGCGif.NumBackground + 1;
01193     }
01194   else 
01195     {
01196       *num = 1;
01197     }
01198   if (*verbose == 1) 
01199     sciprint("\n Background : %d\r\n",*num);
01200 }

Here is the call graph for this function:

void C2F() getclipGif ( integer verbose,
integer x,
integer narg,
double *  dummy 
)

Get the boundaries of the current clip zone

Definition at line 444 of file periGif.c.

References sciprint().

00445 {
00446   x[0] = ScilabGCGif.ClipRegionSet;
00447   if ( x[0] == 1)
00448     {
00449       *narg = 5;
00450       x[1] =ScilabGCGif.CurClipRegion[0];
00451       x[2] =ScilabGCGif.CurClipRegion[1];
00452       x[3] =ScilabGCGif.CurClipRegion[2];
00453       x[4] =ScilabGCGif.CurClipRegion[3];
00454     }
00455   else *narg = 1;
00456   if (*verbose == 1)
00457     {
00458       if (ScilabGCGif.ClipRegionSet == 1)
00459         sciprint("\nThere's a Clip Region :x:%d,y:%d,w:%d,h:%d\r\n",
00460                  ScilabGCGif.CurClipRegion[0],
00461                  ScilabGCGif.CurClipRegion[1],
00462                  ScilabGCGif.CurClipRegion[2],
00463                  ScilabGCGif.CurClipRegion[3]);
00464       else 
00465         sciprint("\nNo Clip Region");
00466     }
00467 }

Here is the call graph for this function:

void C2F() getcolormapGif ( integer v1,
integer v2,
integer v3,
double *  val 
)

Definition at line 1096 of file periGif.c.

References GifIm, sciprint(), and val.

Referenced by setwindowdimGif().

01097 {
01098   int m;
01099   int i;
01100   *v3 = 0;
01101 
01102   if (GifIm == (gdImagePtr)0 ) {
01103     sciprint(" 10.1 xinit must be called before any action \r\n");
01104     return;
01105   }
01106   
01107   m = ScilabGCGif.Numcolors;
01108 
01109   for (i = 0; i < m; i++) {
01110     val[i] = (double)ScilabGCGif.Red[i];
01111     val[i+m] = (double)ScilabGCGif.Green[i];
01112     val[i+2*m] = (double)ScilabGCGif.Blue[i];
01113   }
01114 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() getcolormapsizeGif ( integer v1,
integer v2,
integer v3,
double *  val 
)

void C2F() getcurwinGif ( integer verbose,
integer intnum,
integer narg,
double *  dummy 
)

Get the id number of the Current Graphic Window

Definition at line 400 of file periGif.c.

References sciprint().

00401 {
00402   *narg =1 ;
00403   *intnum = ScilabGCGif.CurWindow ;
00404   if (*verbose == 1) 
00405     sciprint("\nJust one graphic page at a time ");
00406 }

Here is the call graph for this function:

void C2F() getdashGif ( integer verbose,
integer value,
integer narg,
double *  dummy 
)

Referenced by displaystringGif().

Here is the caller graph for this function:

void GetDriverName ( char *  DriverName  ) 

End of graphic (close the file)

Definition at line 181 of file periGif.c.

References GetDriver1(), and NULL.

Referenced by xendgraphicGif().

00182 {    integer *v2 = NULL;
00183      integer *v3 = NULL;
00184      integer *v4 = NULL;
00185      integer *v5 = NULL;
00186      integer *v6 = NULL;
00187      integer *v7 = NULL;
00188      double *dv1 = NULL;
00189      double *dv2 = NULL;
00190      double *dv3 = NULL;
00191      double *dv4 = NULL;
00192      GetDriver1(DriverName, v2, v3, v4, v5, v6, v7, dv1, dv2, dv3, dv4);
00193 }

Here is the call graph for this function:

Here is the caller graph for this function:

char* getenv (  ) 

void C2F() getFontMaxSizeGif ( char *  str,
integer sizeMin,
integer sizeMax,
integer v1,
integer v2,
integer v3,
integer v4,
double *  dx1,
double *  dx2,
double *  dx3,
double *  dx4 
)

get the minimal and maximal font size

Definition at line 2265 of file periGif.c.

References FONTMAXSIZE.

Referenced by xcall_in_word_set().

02266 {
02267   *sizeMin = 0 ;
02268   *sizeMax = FONTMAXSIZE ;
02269 }

Here is the caller graph for this function:

void C2F() getforegroundGif ( integer verbose,
integer num,
integer narg,
double *  dummy 
)

Definition at line 1213 of file periGif.c.

References sciprint().

01214 { 
01215   *narg=1;
01216   if ( ScilabGCGif.CurColorStatus == 1 ) 
01217     {
01218       *num = ScilabGCGif.NumForeground + 1;
01219     }
01220   else 
01221     {
01222       *num = 1; 
01223     }
01224   if (*verbose == 1) 
01225     sciprint("\n Foreground : %d\r\n",*num);
01226 }

Here is the call graph for this function:

void C2F() gethidden3dGif ( integer verbose,
integer num,
integer narg,
double *  dummy 
)

Definition at line 1242 of file periGif.c.

References sciprint().

01243 { 
01244   *narg=1;
01245   if ( ScilabGCGif.CurColorStatus == 1 ) 
01246     {
01247       *num = ScilabGCGif.NumHidden3d + 1;
01248     }
01249   else 
01250     {
01251       *num = 1; 
01252     }
01253   if (*verbose == 1) 
01254     sciprint("\n Hidden3d : %d\r\n",*num);
01255 }

Here is the call graph for this function:

void C2F() getlastGif ( integer verbose,
integer num,
integer narg,
double *  dummy 
)

To get the id of the last pattern

Definition at line 664 of file periGif.c.

References sciprint().

00665 {
00666   *num = ScilabGCGif.IDLastPattern +1 ;
00667   if (*verbose==1) 
00668     sciprint("\n Id of White Pattern %d\r\n",(int)*num);
00669   *narg=1;
00670 }

Here is the call graph for this function:

void C2F() getpatternGif ( integer verbose,
integer num,
integer narg,
double *  dummy 
)

To get the id of the current pattern

Definition at line 644 of file periGif.c.

References sciprint().

Referenced by drawrectanglesGif(), fillarcsGif(), fillpolylineGif(), and fillrectangleGif().

00645 { 
00646 
00647   *narg=1;
00648   if ( ScilabGCGif.CurColorStatus ==1) 
00649     {
00650       *num = ScilabGCGif.CurColor +1 ;
00651       if (*verbose == 1) 
00652         sciprint("\n Color : %d\r\n",*num);
00653     }
00654   else 
00655     {
00656       *num = ScilabGCGif.CurPattern +1 ;
00657       if (*verbose == 1) 
00658         sciprint("\n Pattern : %d\r\n",*num);
00659     }
00660 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() getscilabFigureGif ( integer verbose,
integer x,
integer narg,
double *  figure 
)

void C2F() getscilabVersionGif ( integer verbose,
integer vers,
integer narg,
double *  dummy 
)

void C2F() getscilabxgcGif ( integer verbose,
integer x,
integer narg,
double *  dummy 
)

void C2F() getthicknessGif ( integer verbose,
integer value,
integer narg,
double *  dummy 
)

to get the thicknes value

Definition at line 600 of file periGif.c.

References sciprint().

00601 {
00602   *narg =1 ;
00603   *value = ScilabGCGif.CurLineWidth ;
00604   if (*verbose ==1 ) 
00605     sciprint("\nLine Width:%d\r\n",
00606             ScilabGCGif.CurLineWidth ) ;
00607 }

Here is the call graph for this function:

void C2F() getusecolorGif ( integer verbose,
integer num,
integer narg,
double *  dummy 
)

Definition at line 877 of file periGif.c.

References sciprint().

00878 {
00879   *num = ScilabGCGif.CurColorStatus;
00880   if (*verbose == 1) 
00881     sciprint("\n Use color %d\r\n",(int)*num);
00882   *narg=1;
00883 }

Here is the call graph for this function:

void C2F() getwindowdimGif ( integer verbose,
integer x,
integer narg,
double *  dummy 
)

To get the window size

Definition at line 285 of file periGif.c.

References sciprint().

00286 {     
00287   *narg = 2;
00288   x[0]= ScilabGCGif.CWindowWidth;
00289   x[1]= ScilabGCGif.CWindowHeight;
00290   if (*verbose == 1) 
00291     sciprint("\n CWindow dim :%d,%d\r\n",(int)x[0],(int)x[1]);
00292 } 

Here is the call graph for this function:

void C2F() getwindowposGif ( integer verbose,
integer x,
integer narg,
double *  dummy 
)

to get the window upper-left pointeger coordinates

Definition at line 269 of file periGif.c.

References sciprint().

00270 {
00271   *narg = 2;
00272   x[0]= x[1]=0;
00273   if (*verbose == 1) 
00274     sciprint("\n CWindow position :%d,%d\r\n",(int)x[0],(int)x[1]);
00275  }

Here is the call graph for this function:

static int GifLineColor ( void   )  [static]

Definition at line 709 of file periGif.c.

References gdImageSetStyle(), gdStyled, gdTransparent, GifDashes, GifIm, nGifDashes, and sciprint().

Referenced by displaystringGif(), drawarrowsGif(), drawaxisGif(), drawlineGif(), drawpolylineGif(), drawrectangleGif(), drawrectanglesGif(), drawsegmentsGif(), and fillpolylinesGif().

00710 {
00711     int i, c = col_index[ScilabGCGif.CurColor];
00712 
00713     if (GifIm == (gdImagePtr)0 ) {
00714       sciprint(" 7 xinit must be called before any action \r\n");
00715       return 0;
00716     }
00717     if (c < 0) c = 0;
00718     if (ScilabGCGif.CurDashStyle == 0) return c;
00719     for (i = 0; i < nGifDashes; i++) {
00720         if (GifDashes[i] != gdTransparent) GifDashes[i] = c;
00721     }
00722     gdImageSetStyle(GifIm, GifDashes, nGifDashes);
00723     return gdStyled;
00724 }

Here is the call graph for this function:

Here is the caller graph for this function:

static int GifPatternColor ( int  pat  )  [static]

Definition at line 726 of file periGif.c.

Referenced by drawrectanglesGif(), fillpolylinesGif(), and fillrectangleGif().

00727 {
00728     int c = col_index[pat - 1];
00729     if (c < 0) c = 0;
00730     return c;
00731 }

Here is the caller graph for this function:

void C2F() idfromnameGif ( char *  name1,
integer num 
)

Referenced by setalufunctionGif().

Here is the caller graph for this function:

void C2F() initgraphicfromscreenGif ( char *  string,
integer v2,
integer v3,
integer v4,
integer v5,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

Definition at line 2413 of file periGif.c.

References C2F, CheckScilabXgc(), col_white, dummy, file, FileInitFromScreenGif(), gdImageCreate(), gdImageFilledRectangle(), getwindowdim(), LoadFontsGif(), and xendgraphicGif().

Referenced by xcall_in_word_set().

02414 { 
02415   char string1[256];
02416   static integer EntryCounter = 0;
02417   integer  x[2],verbose=0,narg;
02418   double dummy;
02419   *v3=0;
02420   if (EntryCounter >= 1) 
02421   {
02422       C2F(xendgraphicGif)();
02423   }
02424   strncpy(string1,string,256);
02425 
02426   file=fopen(string1,"wb");
02427   if (file == 0) 
02428     {
02429       /* sciprint("Can't open file %s\n",string1);*/
02430       *v3=1;
02431       return;
02432     }
02433   x[0]=640;
02434   x[1]=480;
02435 
02436   if (CheckScilabXgc()) { 
02437     C2F(getwindowdim)(&verbose, x, &narg,&dummy);
02438   }
02439   
02440   LoadFontsGif();
02441   GifIm = gdImageCreate(x[0], x[1]);
02442 
02443   /*GifFont = gdFontSmall;*/
02444   ScilabGCGif.CWindowWidth  = x[0];
02445   ScilabGCGif.CWindowHeight = x[1];
02446   FileInitFromScreenGif();
02447   ScilabGCGif.CurWindow =EntryCounter;
02448   EntryCounter =EntryCounter +1;
02449   
02450   gdImageFilledRectangle(GifIm, 0, 0, x[0]-1, x[1]-1, col_white); 
02451 
02452 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() initgraphicGif ( char *  string,
integer v2,
integer v3,
integer v4,
integer v5,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

Definition at line 1946 of file periGif.c.

References C2F, CheckScilabXgc(), col_white, dummy, file, FileInitGif(), gdImageCreate(), gdImageFilledRectangle(), getwindowdim(), LoadFontsGif(), and xendgraphicGif().

Referenced by xcall_in_word_set().

01947 { 
01948   char string1[256];
01949   static integer EntryCounter = 0;
01950   integer  x[2],verbose=0,narg;
01951   double dummy;
01952   *v3=0;
01953   if (EntryCounter >= 1) 
01954   {
01955       C2F(xendgraphicGif)();
01956   }
01957   strncpy(string1,string,256);
01958 
01959   file=fopen(string1,"wb");
01960   if (file == 0) 
01961     {
01962       /* sciprint("Can't open file %s\n",string1);*/
01963       *v3=1;
01964       return;
01965     }
01966   x[0]=640;
01967   x[1]=480;
01968 
01969   if (CheckScilabXgc()) { 
01970     C2F(getwindowdim)(&verbose, x, &narg,&dummy);
01971   }
01972   
01973   LoadFontsGif();
01974   GifIm = gdImageCreate(x[0], x[1]);
01975 
01976   /*GifFont = gdFontSmall;*/
01977   ScilabGCGif.CWindowWidth  = x[0];
01978   ScilabGCGif.CWindowHeight = x[1];
01979   FileInitGif();
01980   ScilabGCGif.CurWindow =EntryCounter;
01981   EntryCounter =EntryCounter +1;
01982   
01983   gdImageFilledRectangle(GifIm, 0, 0, x[0]-1, x[1]-1, col_white); 
01984 
01985 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() InitScilabGCGif ( integer v1,
integer v2,
integer v3,
integer v4 
)

void C2F() loadfamilyGif ( char *  name,
integer j,
integer v3,
integer v4,
integer v5,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

Definition at line 2277 of file periGif.c.

References ff, fname, font, FontInfoTabGif, FontListGif, FONTMAXSIZE, FREE, getSCIpath(), ierr, NULL, FontInfo::ok, ok, ReadbdfFont(), sciprint(), and strchr().

Referenced by LoadFontsGif(), and xcall_in_word_set().

02278 {
02279   FILE *ff;
02280   char fname[1024];
02281   int i,ierr;
02282   char *SciPath;
02283   gdFontPtr font;
02284 
02286   if ( strchr(name,'%') != (char *) NULL)  /* no apriori it is an X11 font name */
02287     {
02288       sciprint("only alias font name are supported by gif driver\n");
02289       return;
02290     }
02291   SciPath=getSCIpath();
02292   if (SciPath==NULL)
02293     {
02294       sciprint("The SCI environment variable is not set\n");
02295       return;
02296     }
02297   fname[0]=0;
02298 
02299   if (FontInfoTabGif[*j].ok == 1) { /* Font number already used */
02300     if (strcmp(FontInfoTabGif[*j].fname,name)!=0) { /* by a different font */
02301       /* unload this font */
02302       FontInfoTabGif[*j].ok = 0;
02303       for (i=0;i<FONTMAXSIZE;i++) {
02304         font = &(FontListGif[*j][i]);
02305           if (font != NULL) FREE(font->data);
02306       }
02307     }
02308   }
02309   if (FontInfoTabGif[*j].ok == 0) {
02310     for (i=0;i<FONTMAXSIZE;i++) {
02311       sprintf(fname,"%s/modules/graphics/fonts/giffonts/75dpi/%s%s.bdf",SciPath,name,sizeGif[i]);
02312       ff=fopen(fname,"r");
02313       if (ff == 0) 
02314         {
02315           sciprint("Can't open font file %s\n",fname);
02316           return;
02317         }
02318       ierr=ReadbdfFont(ff,&(FontListGif[*j][i]),fname);
02319       fclose(ff);
02320       if  (ierr==1) {
02321         sciprint("\n Cannot allocate memory for font : %s%s\n",name,sizeGif[i]);
02322         return;
02323       }
02324       if  (ierr==2) {
02325         sciprint("\n Font not found: %s%s\n",name,sizeGif[i]);
02326         return;
02327       }
02328       
02329 
02330       FontInfoTabGif[*j].ok = 1;
02331       strcpy(FontInfoTabGif[*j].fname,name);
02332     }
02333   }
02334 }

Here is the call graph for this function:

Here is the caller graph for this function:

static void LoadFontsGif ( void   )  [static]

Definition at line 2349 of file periGif.c.

References C2F, and loadfamilyGif().

Referenced by initgraphicfromscreenGif(), and initgraphicGif().

02350 {
02351   int i;
02352 
02353   /*CourR */
02354   i = 0;
02355   C2F(loadfamilyGif)("courR",&i,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0); 
02356 
02357   /*Symb */
02358   i = 1;
02359   C2F(loadfamilyGif)("symb",&i,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0); 
02360 
02361   /*TimR */
02362   i = 2;
02363   C2F(loadfamilyGif)("timR",&i,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0);
02364  
02365   /*timI */
02366   /* i = 3;
02367      C2F(loadfamilyGif)("timI",&i,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0);*/
02368 
02369   /*timB */
02370   /* i = 4;
02371   C2F(loadfamilyGif)("timB",&i,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0);*/
02372 
02373  /*timBI */
02374   /* i = 5;
02375      C2F(loadfamilyGif)("timBI",&i,PI0,PI0,PI0,PI0,PI0,PD0,PD0,PD0,PD0);*/
02376 
02377 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() nues1 (  ) 

void C2F() queryfamilyGif ( char *  name,
integer j,
integer v3,
integer v4,
integer v5,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

Definition at line 2336 of file periGif.c.

References fname, FontInfoTabGif, and FONTNUMBER.

Referenced by xcall_in_word_set().

02337 { 
02338   integer i ;
02339   name[0]='\0';
02340   for (i=0;i<FONTNUMBER;i++) {
02341     v3[i]=strlen(FontInfoTabGif[i].fname);
02342     strcat(name,FontInfoTabGif[i].fname);
02343   }
02344   *j=FONTNUMBER;
02345 }

Here is the caller graph for this function:

int ReadbdfFont (  ) 

Referenced by loadfamilyGif().

Here is the caller graph for this function:

void C2F() scilabgcgetGif ( char *  str,
integer verbose,
integer x1,
integer x2,
integer x3,
integer x4,
integer x5,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

Definition at line 1349 of file periGif.c.

References C2F, L, and ScilabGCGetorSetGif().

Referenced by xcall_in_word_set().

01350 {
01351   int x6=0;
01352   C2F(ScilabGCGetorSetGif)(str,(integer)1L,verbose,x1,x2,x3,x4,x5,&x6,dv1);
01353 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() ScilabGCGetorSetGif ( char *  str,
integer  flag,
integer verbose,
integer x1,
integer x2,
integer x3,
integer x4,
integer x5,
integer x6,
double *  dx1 
)

Referenced by scilabgcgetGif(), and scilabgcsetGif().

Here is the caller graph for this function:

void C2F() scilabgcsetGif ( char *  str,
integer x1,
integer x2,
integer x3,
integer x4,
integer x5,
integer x6,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

Definition at line 1355 of file periGif.c.

References C2F, L, and ScilabGCGetorSetGif().

Referenced by xcall_in_word_set().

01356 {
01357  integer verbose ;
01358  verbose = 0 ;
01359  C2F(ScilabGCGetorSetGif)(str,(integer)0L,&verbose,x1,x2,x3,x4,x5,x6,dv1);}

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() semptyGif ( integer v1,
integer v2,
integer v3,
integer v4 
)

Definition at line 1264 of file periGif.c.

References C2F, and setwwhowGif().

01265 {
01266   
01267 }

Here is the call graph for this function:

void C2F() set_cGif ( integer  i  ) 

Referenced by setpatternGif().

Here is the caller graph for this function:

static void C2F() set_dash_and_color_Gif ( integer value,
integer v2,
integer v3,
integer v4 
) [static]

Definition at line 763 of file periGif.c.

References C2F, setdashGif(), and setpatternGif().

Referenced by drawarcsGif(), drawarrowsGif(), drawpolylinesGif(), drawrectanglesGif(), and drawsegmentsGif().

00764 {
00765   C2F(setdashGif)(value, v2, v3, v4);
00766   C2F(setpatternGif)(value+6, v2, v3, v4);
00767 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() set_dash_or_color_Gif ( integer value,
integer v2,
integer v3,
integer v4 
)

Referenced by drawsegmentsGif().

Here is the caller graph for this function:

void C2F() set_line_style_Gif ( integer value,
integer v2,
integer v3,
integer v4 
)

Referenced by drawarcsGif(), drawarrowsGif(), drawpolylinesGif(), and drawrectanglesGif().

Here is the caller graph for this function:

void C2F() setabsourelGif ( integer num,
integer v2,
integer v3,
integer v4 
)

Definition at line 476 of file periGif.c.

References CoordModeOrigin, and CoordModePrevious.

00477 {
00478   if (*num == CoordModeOrigin )
00479     ScilabGCGif.CurVectorStyle =  CoordModeOrigin;
00480   else 
00481     ScilabGCGif.CurVectorStyle =  CoordModePrevious ;
00482 }

void C2F() setalufunction1Gif ( integer num,
integer v2,
integer v3,
integer v4 
)

Definition at line 556 of file periGif.c.

References AluStrucGif, gdSetAlu(), GifIm, alinfo::id, Max, Min, and sciprint().

Referenced by setgccolormapGif().

00557 {     
00558   integer value;
00559 
00560   if (GifIm == (gdImagePtr)0 ) {
00561     sciprint(" 6 xinit must be called before any action \r\n");
00562     return;
00563   }
00564   value=AluStrucGif[Min(15,Max(0,*num))].id;
00565   if ( value != -1)
00566     {
00567       ScilabGCGif.CurDrawFunction = value;
00568       gdSetAlu(GifIm, value);
00569     }
00570 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() setalufunctionGif ( char *  string  ) 

Definition at line 500 of file periGif.c.

References C2F, gdSetAlu(), GifIm, idfromnameGif(), and sciprint().

Referenced by InitScilabGCGif(), and setwindowdimGif().

00501 {    
00502   integer value;
00503   if (GifIm == (gdImagePtr)0 ) {
00504     sciprint(" 5 xinit must be called before any action \r\n");
00505     return;
00506   }
00507   C2F(idfromnameGif)(string,&value);
00508   if ( value != -1) {
00509      ScilabGCGif.CurDrawFunction = value;
00510      gdSetAlu(GifIm, value);
00511 /*     FPRINTF((file,"\n%% %d setalufunction",(int)value)); */
00512   }
00513 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() setbackgroundGif ( integer num,
integer v2,
integer v3,
integer v4 
)

set and get the number of the background or foreground

Referenced by InitScilabGCGif(), and setwindowdimGif().

Here is the caller graph for this function:

void C2F() setclipGif ( integer x,
integer y,
integer w,
integer h 
)

Set a clip zone (rectangle )

Definition at line 410 of file periGif.c.

References gdSetClipping(), GifIm, and sciprint().

00411 {
00412   if (GifIm == (gdImagePtr)0 ) {
00413     sciprint(" 3 xinit must be called before any action \r\n");
00414     return;
00415   }
00416   ScilabGCGif.ClipRegionSet = 1;
00417   ScilabGCGif.CurClipRegion[0]= *x;
00418   ScilabGCGif.CurClipRegion[1]= *y;
00419   ScilabGCGif.CurClipRegion[2]= *w;
00420   ScilabGCGif.CurClipRegion[3]= *h;
00421   gdSetClipping(GifIm,*x,*y,*x+*w,*y+*h); 
00422 /*  FPRINTF((file,"\n%d %d %d %d setclipzone",(int)*x,(int)*y,(int)*w,(int)*h));*/
00423 }

Here is the call graph for this function:

void setcolormapgGif ( struct BCG Xgc,
integer v1,
integer v2,
double *  a,
integer v3 
)

Definition at line 1118 of file periGif.c.

References C2F, and setgccolormapGif().

01119 {
01120   C2F(setgccolormapGif)(Xgc,*m, a, v3);
01121 }

Here is the call graph for this function:

void C2F() setcolormapGif ( integer v1,
integer v2,
integer v3,
integer v4,
integer v5,
integer v6,
double *  a 
)

Definition at line 1063 of file periGif.c.

References C2F, GifIm, sciprint(), and setgccolormapGif().

01064 {
01065   int m;
01066 
01067   *v3 = 0;
01068 
01069   if (*v2 != 3 ||  *v1 < 0 ) {
01070     sciprint("Colormap must be a m x 3 array \n");
01071     *v3 = 1;
01072     return;
01073   }
01074   if (GifIm == (gdImagePtr)0 ) {
01075     sciprint(" 10 xinit must be called before any action \r\n");
01076     *v3 = 1;
01077     return;
01078   }
01079   m = *v1;
01080 
01081   C2F(setgccolormapGif)(&ScilabGCGif,m, a, v3);
01082 }

Here is the call graph for this function:

void C2F() setcurwinGif ( integer intnum,
integer v2,
integer v3,
integer v4 
)

Select a graphic Window : Empty for GIF

Definition at line 393 of file periGif.c.

00394 {
00395   ScilabGCGif.CurWindow = *intnum;
00396 }

void C2F() setdashGif ( integer value,
integer v2,
integer v3,
integer v4 
)

Definition at line 701 of file periGif.c.

References C2F, Max, Min, and setdashstyleGif().

Referenced by displaystringGif(), drawpolylinesGif(), InitScilabGCGif(), set_dash_and_color_Gif(), setwindowdimGif(), and usecolorGif().

00702 {
00703   static integer maxdash = 6, l2=4,l3 ;
00704   l3 = Max(0,Min(maxdash - 1,*value - 1));
00705   C2F(setdashstyleGif)(&l3,DashTabGif[l3],&l2);
00706   ScilabGCGif.CurDashStyle = l3;
00707 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() setdashstyleGif ( integer value,
integer xx,
integer n 
)

xx[3]={5,3,7} and *n == 3 means : 5white 3 void 7 white

Referenced by setdashGif().

Here is the caller graph for this function:

void C2F() setforegroundGif ( integer num,
integer v2,
integer v3,
integer v4 
)

set and get the number of the background or foreground

Referenced by InitScilabGCGif(), and setwindowdimGif().

Here is the caller graph for this function:

void C2F() setgccolormapGif ( struct BCG Xgc,
integer  m,
double *  a,
integer v3 
)

Definition at line 904 of file periGif.c.

References b, BCG::Blue, C2F, col_white, COLORMAP_WARNING, gdImageStruct::colorsTotal, BCG::CWindowHeight, BCG::CWindowWidth, FREE, g, gdImageColorAllocate(), gdImageColorDeallocate(), gdImageGetPixel(), gdImageSetPixel(), gdMaxColors, GifIm, BCG::Green, i1, BCG::IDLastPattern, ierr, ind, int, j, m1, MALLOC, nues1(), NULL, BCG::NumBackground, BCG::Numcolors, BCG::NumForeground, PI0, BCG::Red, sciprint(), setalufunction1Gif(), setpatternGif(), and usecolorGif().

Referenced by setcolormapgGif(), setcolormapGif(), and setwindowdimGif().

00905 {
00906   int i,j,r,g,b,c,ierr,m1,mm;
00907   double *cmap;
00908   int *ind,i1;
00909   int old_white,old_black;
00910   if (GifIm == (gdImagePtr)0 ) {
00911     sciprint(" 9 xinit must be called before any action \r\n");
00912     *v3 = 1;
00913     return;
00914   }
00915   
00916   /* Checking RGB values */
00917   for (i = 0; i < m; i++) {
00918     if (a[i] < 0 || a[i] > 1 || a[i+m] < 0 || a[i+m] > 1 ||
00919         a[i+2*m] < 0 || a[i+2*m]> 1) {
00920       sciprint("RGB values must be between 0 and 1\n");
00921       *v3 = 1;
00922       return;
00923     }
00924   }
00925   old_white=col_index[Xgc->Numcolors+1];
00926   old_black=col_index[Xgc->Numcolors];
00927   /* deallocate old colors*/
00928   for ( i=0; i < GifIm->colorsTotal; i++) 
00929     gdImageColorDeallocate(GifIm, i);
00930   for ( i=0;i < Xgc->Numcolors+2; i++) 
00931     col_index[i] = -1;
00932 
00933   if (m>gdMaxColors-3) 
00934   {
00935 /* reduce the number of colors */
00936     sciprint(COLORMAP_WARNING,gdMaxColors-2) ;
00937       m1 = gdMaxColors-2;
00938     if ( (cmap = (double*) MALLOC(3*m1 * sizeof(double)))== NULL) {
00939       sciprint("Not enough memory\n");
00940       *v3 = 1;
00941       return;
00942     }
00943     if ( (ind = (int*) MALLOC(m * sizeof(int)))== NULL) {
00944       sciprint("Not enough memory\n");
00945       FREE(cmap);
00946       *v3 = 1;
00947       return;
00948     }
00949 
00950     C2F(nues1)(a,&m,cmap,&m1,ind,&ierr);
00951     /* create new colormap */
00952     Xgc->Numcolors = m;
00953     for ( i=0; i < Xgc->Numcolors; i++) {
00954       i1 = ind[i] - 1;
00955       r=(int)(cmap[i1] * 255);
00956       g=(int)(cmap[i1 + m1] * 255);
00957       b=(int)(cmap[i1 + 2*m1] * 255);
00958       if (r==255 && g==255 && b==255) {
00959         /* move white a little to distinguish it from the background */
00960         r=254;g=254;b=254; }
00961       /*c = gdImageColorExact(GifIm, r,g,b);
00962         if (c == -1)*/
00963       c = gdImageColorAllocate(GifIm,r,g,b);
00964       col_index[i] = c;
00965     }
00966     FREE(ind);
00967     FREE(cmap);
00968   }
00969   else {
00970     /* create new colormap */
00971     Xgc->Numcolors = m;
00972     for ( i=0; i < Xgc->Numcolors; i++) {
00973       r=(int)(a[i] * 255);
00974       g=(int)(a[i + m] * 255);
00975       b=(int)(a[i + 2*m] * 255);
00976       if (r==255&&g==255&&b==255) {
00977         /* move white a little to distinguish it from the background */
00978         r=254;g=254;b=254; }
00979       /*c = gdImageColorExact(GifIm, r,g,b);
00980         if (c == -1)*/
00981         c = gdImageColorAllocate(GifIm,r,g,b);
00982       col_index[i] = c;
00983     }
00984   }
00985   /* adding white and black color at the end */
00986   /*c = gdImageColorExact(GifIm, 0,0,0);
00987   if (c == -1) */
00988   c = gdImageColorAllocate(GifIm,0,0,0);
00989   col_index[m]=c;
00990   /*c = gdImageColorExact(GifIm, 255,255,255);
00991   if (c == -1) */
00992   c = gdImageColorAllocate(GifIm,255,255,255);
00993   col_index[m+1]=c;
00994   col_white=c;
00995 
00996   Xgc->IDLastPattern = m - 1;
00997   Xgc->NumForeground = m;
00998   Xgc->NumBackground = m + 1;
00999 
01000 
01001   C2F(usecolorGif)((i=1,&i) ,PI0,PI0,PI0);
01002   C2F(setalufunction1Gif)((i=3,&i),PI0,PI0,PI0);
01003   C2F(setpatternGif)((i=Xgc->NumForeground+1,&i),PI0,PI0,PI0);  
01004 
01005   /* next line added to change the pixel color index for pixel painted with 
01006      the default white and black*/
01007 
01008   for (i=0;i<Xgc->CWindowWidth;i++) {
01009     for (j=0;j<Xgc->CWindowHeight;j++) {
01010       c=gdImageGetPixel(GifIm, i, j);
01011       if(c==old_white)
01012         gdImageSetPixel(GifIm, i, j,col_index[m+1]);
01013       else if (c==old_black)
01014         gdImageSetPixel(GifIm, i, j,col_index[m]);
01015     }
01016   }
01017 
01018   /* -------------------------------------------------------- */
01019   /* store the colormap for the get command too */
01020   /* F.Leray 04.10.05 */
01021   FREE(Xgc->Red);
01022   FREE(Xgc->Green);
01023   FREE(Xgc->Blue);
01024   
01025   /* don't forget black and white */
01026   mm = m;
01027   if (!(Xgc->Red = (float *) MALLOC(mm*sizeof(float)))) {
01028     sciprint("XgcAllocColors: unable to alloc\n");
01029     return;
01030   }
01031   if (!(Xgc->Green = (float *) MALLOC(mm*sizeof(float)))) {
01032     sciprint("XgcAllocColors: unable to alloc\n");
01033     FREE(Xgc->Red);
01034     return;
01035   }
01036   if (!(Xgc->Blue = (float *) MALLOC(mm*sizeof(float)))) {
01037     sciprint("XgcAllocColors: unable to alloc\n");
01038     FREE(Xgc->Red);
01039     FREE(Xgc->Green);
01040     return;
01041   }
01042 
01043   for(i=0;i<m;i++){
01044     Xgc->Red[i] = (float)a[i];
01045     Xgc->Green[i] = (float)a[i+m];
01046     Xgc->Blue[i] = (float)a[i+2*m]; 
01047   }
01048   /* -------------------------------------------------------- */
01049 
01050 
01051   /* next line added by bruno (7 dec 2004) to (badly) correct the bug 1112 */
01052    /* gdImageFilledRectangle(GifIm, 0, 0, Xgc->CWindowWidth-1, Xgc->CWindowHeight-1, col_white);*/
01053   /* Note: Fabrice has also added some code in clearwindowgif function but this doesn't */
01054   /* correct the problem for the old graphic mode (rmk: this added line seems to correct  */
01055   /* the bug for both mode) */
01056 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() sethidden3dGif ( integer num,
integer v2,
integer v3,
integer v4 
)

set and get the number of the hidden3d color

Definition at line 1232 of file periGif.c.

References Max, and Min.

Referenced by InitScilabGCGif(), and setwindowdimGif().

01233 { 
01234   if (ScilabGCGif.CurColorStatus == 1) 
01235     {
01236       /* e Segre: Max(0,... -> Max(-1,... */
01237       /* S Mottelet: Max(-1,... -> Max(-2,...  to take into account the value -1 */
01238       ScilabGCGif.NumHidden3d = Max(-2,Min(*num - 1,ScilabGCGif.Numcolors + 1));
01239     }
01240 }

Here is the caller graph for this function:

void C2F() setpatternGif ( integer num,
integer v2,
integer v3,
integer v4 
)

Definition at line 617 of file periGif.c.

References C2F, GREYNUMBER, i, Max, Min, and set_cGif().

Referenced by ColorInitGif(), drawsegmentsGif(), FileInitFromScreenGif(), FileInitGif(), fillarcsGif(), InitScilabGCGif(), set_dash_and_color_Gif(), setgccolormapGif(), setwindowdimGif(), and usecolorGif().

00618 {
00619  integer i ; 
00620   if ( ScilabGCGif.CurColorStatus ==1) 
00621     {
00622       i= Max(0,Min(*num-1,ScilabGCGif.Numcolors+1));
00623       ScilabGCGif.CurColor = i ;
00624       C2F(set_cGif)(i);
00625     }
00626   else 
00627     {
00628       /* used when printing from color to b&white color after GREYNUMBER 
00629        are translated to black */
00630       if ( *num-1 > GREYNUMBER -1 ) 
00631         i=0;
00632       else 
00633         i= Max(0,Min(*num-1,GREYNUMBER-1));
00634       ScilabGCGif.CurPattern = i;
00635 /*      if (i ==0)
00636         FPRINTF((file,"\nfillsolid"));
00637       else 
00638         FPRINTF((file,"\n%d Setgray",(int)i)); */
00639     }
00640 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() setscilabFigureGif ( integer v1,
integer v2,
integer v3,
integer v4,
integer v5,
integer v6,
double *  figure 
)

void C2F() setscilabVersionGif ( integer vers,
integer v2,
integer v3,
integer v4 
)

void C2F() setscilabxgcGif ( integer v1,
integer v2,
integer v3,
integer v4 
)

void C2F() setthicknessGif ( integer value,
integer v2,
integer v3,
integer v4 
)

Definition at line 593 of file periGif.c.

References Max.

Referenced by InitScilabGCGif(), and setwindowdimGif().

00594 { 
00595   ScilabGCGif.CurLineWidth =Max(0, *value);
00596 }

Here is the caller graph for this function:

void C2F() setwindowdimGif ( integer x,
integer y,
integer v3,
integer v4 
)

To change the window dimensions

retirer le clipping

trac\'e absolu

we force CurColorStatus to the opposite value of col to force usecolorGif to perform initialisations

Definition at line 296 of file periGif.c.

References C2F, col_white, ColorInitGif(), CoordModeOrigin, FREE, gdImageCopyResized(), gdImageCreate(), gdImageDestroy(), gdImageFilledRectangle(), getcolordef(), getcolormapGif(), GifIm, GREYNUMBER, i, InitScilabGCGif(), j, MALLOC, NULL, PI0, sciprint(), setalufunctionGif(), setbackgroundGif(), setdashGif(), setforegroundGif(), setgccolormapGif(), sethidden3dGif(), setpatternGif(), setthicknessGif(), unsetclipGif(), usecolorGif(), v, val, vdouble, xsetfontGif(), and xsetmarkGif().

00297 {
00298   integer x2[2],verbose,narg;
00299   integer old_num;
00300   integer i,j,col,v;
00301   double *val = NULL;
00302   
00303 
00304   gdImagePtr GifImOld = GifIm;
00305 
00306   if (GifIm == (gdImagePtr)0 ) {
00307     sciprint(" 2 xinit must be called before any action \r\n");
00308     return;
00309   }
00310   GifIm = gdImageCreate(*x, *y);
00311 
00312   /*  ScilabGCGif.CWindowWidth  = *x;
00313       ScilabGCGif.CWindowHeight = *y; */
00314   
00315   
00316   /* save current colormap */
00317   old_num = ScilabGCGif.Numcolors;
00318   
00319   if((val=MALLOC((old_num*3)*sizeof(double)))==NULL)
00320     {
00321       sciprint("Error: can not allocate temporary coloramp\n");
00322       return;
00323     }
00324   
00325   C2F(getcolormapGif)(&v,&v,&v,val);
00326   /* end save current colormap */
00327   
00328   verbose = 0; 
00329   C2F(getwindowdimGif)(&verbose,x2,&narg,vdouble);
00330   
00331   ColorInitGif();
00332 
00333   InitScilabGCGif(PI0,PI0,PI0,PI0);
00334 
00335   ScilabGCGif.IDLastPattern = GREYNUMBER-1;
00336   ScilabGCGif.CurLineWidth=0 ;
00337   i=1;
00338   C2F(setthicknessGif)(&i,PI0,PI0,PI0);
00339   C2F(setalufunctionGif)("GXcopy");
00341   i=j= -1;
00342   C2F(unsetclipGif)(PI0,PI0,PI0,PI0);
00343   C2F(xsetfontGif)((i=2,&i),(j=1,&j),PI0,PI0);
00344   C2F(xsetmarkGif)((i=0,&i),(j=0,&j),PI0,PI0);
00346   ScilabGCGif.CurVectorStyle = CoordModeOrigin ;
00347   /* initialisation des pattern dash par defaut en n&b */
00348   ScilabGCGif.CurColorStatus =0;
00349   C2F(setpatternGif)((i=1,&i),PI0,PI0,PI0);
00350   C2F(setdashGif)((i=1,&i),PI0,PI0,PI0);
00351   
00352   /* initialisation de la couleur par defaut */
00353   ScilabGCGif.CurColorStatus = 1 ;
00354   C2F(setpatternGif)((i=1,&i),PI0,PI0,PI0);
00355   C2F(setforegroundGif)((i=ScilabGCGif.NumForeground+1,&i),PI0,PI0,PI0);
00356   C2F(setbackgroundGif)((i=ScilabGCGif.NumForeground+2,&i),PI0,PI0,PI0);
00357   C2F(sethidden3dGif)((i=4,&i),PI0,PI0,PI0);
00358   /* Choix du mode par defaut (decide dans initgraphic_ */
00359   getcolordef(&col);
00364   ScilabGCGif.CurColorStatus = (col == 1) ? 0: 1;
00365   C2F(usecolorGif)(&col,PI0,PI0,PI0);
00366   if (col == 1) ScilabGCGif.IDLastPattern = ScilabGCGif.Numcolors - 1;
00367   strcpy(ScilabGCGif.CurNumberDispFormat,"%-5.2g");
00368 
00369   C2F(setpatternGif)((i=ScilabGCGif.NumForeground+1,&i),PI0,PI0,PI0); 
00370   if (ScilabGCGif.CurColorStatus == 1) 
00371     {
00372       ScilabGCGif.IDLastPattern = ScilabGCGif.Numcolors - 1;
00373     }
00374 
00375   /* reset correct colormap */
00376   C2F(setgccolormapGif)(&ScilabGCGif,old_num, val, &v);
00377   
00378   FREE(val); val = (double *) NULL;
00379   /* end reset correct colormap */
00380 
00381   gdImageFilledRectangle(GifIm, 0, 0, (*x) - 1, (*y) - 1, col_white);
00382 
00383   gdImageCopyResized(GifIm, GifImOld, 0, 0, 0, 0, *x, *y, 
00384               ScilabGCGif.CWindowWidth,
00385               ScilabGCGif.CWindowHeight);
00386   gdImageDestroy(GifImOld);
00387   ScilabGCGif.CWindowWidth  = *x;
00388   ScilabGCGif.CWindowHeight = *y;
00389 }

Here is the call graph for this function:

void C2F() setwindowposGif ( integer x,
integer y,
integer v3,
integer v4 
)

to set the window upper-left pointeger position (Void)

Definition at line 279 of file periGif.c.

00280 {
00281 }

void C2F() setwwhowGif ( integer verbose,
integer v2,
integer v3,
integer v4 
)

Referenced by semptyGif().

Here is the caller graph for this function:

void C2F() unsetclipGif ( integer v1,
integer v2,
integer v3,
integer v4 
)

unset clip zone

Definition at line 427 of file periGif.c.

References gdUnsetClipping(), GifIm, and sciprint().

Referenced by InitScilabGCGif(), and setwindowdimGif().

00428 {
00429   if (GifIm == (gdImagePtr)0 ) {
00430     sciprint(" 4 xinit must be called before any action \r\n");
00431     return;
00432   }
00433   ScilabGCGif.ClipRegionSet = 0;
00434   ScilabGCGif.CurClipRegion[0]= -1;
00435   ScilabGCGif.CurClipRegion[1]= -1;
00436   ScilabGCGif.CurClipRegion[2]= 200000;
00437   ScilabGCGif.CurClipRegion[3]= 200000;
00438   gdUnsetClipping(GifIm);
00439 /*  FPRINTF((file,"\n%d %d %d %d setclipzone",-1,-1,200000,200000));*/
00440 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() usecolorGif ( integer num,
integer v2,
integer v3,
integer v4 
)

Definition at line 839 of file periGif.c.

References C2F, GREYNUMBER, Max, Min, PI0, setdashGif(), and setpatternGif().

Referenced by InitScilabGCGif(), setgccolormapGif(), and setwindowdimGif().

00840 {
00841   integer i;
00842   i =  Min(Max(*num,0),1);
00843   if ( ScilabGCGif.CurColorStatus != (int)i)
00844     {
00845       if (ScilabGCGif.CurColorStatus == 1) 
00846         {
00847           /* je passe de Couleur a n&b */
00848           /* remise des couleurs a vide */
00849           ScilabGCGif.CurColorStatus = 1;
00850           C2F(setpatternGif)((i=1,&i),PI0,PI0,PI0);
00851           /* passage en n&b */
00852           ScilabGCGif.CurColorStatus = 0;
00853           i= ScilabGCGif.CurPattern+1;
00854           C2F(setpatternGif)(&i,PI0,PI0,PI0);
00855           i= ScilabGCGif.CurDashStyle+1;
00856           C2F(setdashGif)(&i,PI0,PI0,PI0);
00857           ScilabGCGif.IDLastPattern = GREYNUMBER - 1;
00858         }
00859       else 
00860         {
00861           /* je passe en couleur */
00862           /* remise a zero des patterns et dash */
00863           /* remise des couleurs a vide */
00864           ScilabGCGif.CurColorStatus = 0;
00865           C2F(setpatternGif)((i=1,&i),PI0,PI0,PI0);
00866           C2F(setdashGif)((i=1,&i),PI0,PI0,PI0);
00867           /* passage en couleur  */
00868           ScilabGCGif.CurColorStatus = 1;
00869           i= ScilabGCGif.CurColor+1;
00870           C2F(setpatternGif)(&i,PI0,PI0,PI0);
00871           ScilabGCGif.IDLastPattern = ScilabGCGif.Numcolors - 1;
00872         }
00873     }
00874 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() Write2VectGif (  ) 

void C2F() WriteGeneric1Gif (  ) 

void C2F() WriteGenericGif ( char *  string,
integer  nobj,
integer  sizeobj,
integer vx,
integer vy,
integer  sizev,
integer  flag,
integer fvect 
)

void C2F() xclick_anyGif ( char *  str,
integer ibutton,
integer xx1,
integer yy1,
integer v5,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

Definition at line 248 of file periGif.c.

Referenced by xcall_in_word_set().

00249 { }

Here is the caller graph for this function:

void C2F() xclickGif ( char *  str,
integer ibutton,
integer xx1,
integer yy1,
integer v5,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

Wait for mouse click in graphic window : Empty here

Definition at line 245 of file periGif.c.

Referenced by xcall_in_word_set().

00246 { }

Here is the caller graph for this function:

void C2F() xendGif ( char *  v1,
integer v2,
integer v3,
integer v4,
integer v5,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

Definition at line 215 of file periGif.c.

References C2F, and xendgraphicGif().

Referenced by xcall_in_word_set().

00216 {
00217   C2F(xendgraphicGif)();
00218 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() xendgraphicGif ( void   ) 

Definition at line 195 of file periGif.c.

References col_white, DriverName, file, gdImageChangeColor(), gdImageDestroy(), gdImageGif(), gdImagePPM(), gdSetBackground(), GetDriverName(), GifIm, and num.

Referenced by initgraphicfromscreenGif(), initgraphicGif(), and xendGif().

00196 {
00197   char DriverName[10];
00198   integer num;
00199   if (file != stdout && file != (FILE*) 0 && GifIm != (gdImagePtr)0) {
00200     num = ScilabGCGif.NumBackground;
00201     gdImageChangeColor(GifIm,col_white,col_index[num]);
00202     gdSetBackground(GifIm,col_index[num] );
00203     GetDriverName(DriverName);
00204     if (strcmp(DriverName,"GIF")==0)
00205       gdImageGif(GifIm, file);
00206     else if (strcmp(DriverName,"PPM")==0)
00207       gdImagePPM(GifIm, file);
00208     fclose(file);
00209     gdImageDestroy(GifIm);
00210         GifIm = (gdImagePtr)0; /* F.Leray 25.08.04 */
00211     file=stdout;
00212   }
00213 }

Here is the call graph for this function:

Here is the caller graph for this function:

void C2F() xgetfontGif ( integer verbose,
integer font,
integer nargs,
double *  dummy 
)

To get the values id and size of the current font

void C2F() xgetmarkGif ( integer verbose,
integer symb,
integer narg,
double *  dummy 
)

To get the current mark id

Referenced by drawpolylinesGif().

Here is the caller graph for this function:

void C2F() xgetmouseGif ( char *  str,
integer ibutton,
integer xx1,
integer yy1,
integer v5,
integer v6,
integer v7,
double *  dv1,
double *  dv2,
double *  dv3,
double *  dv4 
)

Definition at line 251 of file periGif.c.

Referenced by xcall_in_word_set().

00252 { }

Here is the caller graph for this function:

void C2F() xsetfontGif ( integer fontid,
integer fontsize,
integer v3,
integer v4 
)

To set the current font id of font and size

Referenced by drawpolymarkGif(), InitScilabGCGif(), and setwindowdimGif().

Here is the caller graph for this function:

void C2F() xsetmarkGif ( integer number,
integer size,
integer v3,
integer v4 
)

To set the current mark : using the symbol font of adobe

Referenced by drawpolylinesGif(), InitScilabGCGif(), and setwindowdimGif().

Here is the caller graph for this function:


Variable Documentation

struct alinfo AluStrucGif[]

All the possibilities : Read The X11 manual to get more informations

Referenced by getalufunctionGif(), and setalufunction1Gif().

int col_white [static]

Definition at line 131 of file periGif.c.

Referenced by ColorInitGif(), FileInitFromScreenGif(), initgraphicfromscreenGif(), initgraphicGif(), setgccolormapGif(), setwindowdimGif(), and xendgraphicGif().

integer DashTabGif[MAXDASH][4] [static]

Initial value:

 {
  {2,5,2,5}, {7,2,7,2},  {2,2,2,2}, {7,2,2,2},
  {11,3,2,3}, {11,3,5,3}}

Definition at line 678 of file periGif.c.

FILE* file = stdout [static]

Definition at line 88 of file periGif.c.

struct FontInfo FontInfoTabGif[FONTNUMBER]

Referenced by loadfamilyGif(), and queryfamilyGif().

gdFont FontListGif[FONTNUMBER][FONTMAXSIZE]

Definition at line 2141 of file periGif.c.

Referenced by loadfamilyGif().

FontAlias fonttab[] [static]

Initial value:

{
  {"courR", "-adobe-courier-medium-r-normal--*-%s0-*-*-m-*-iso8859-1"},
  {"symb", "-adobe-symbol-medium-r-normal--*-%s0-*-*-p-*-adobe-fontspecific"},
  {"timR", "-adobe-times-medium-r-normal--*-%s0-*-*-p-*-iso8859-1"},
  {"timI", "-adobe-times-medium-i-normal--*-%s0-*-*-p-*-iso8859-1"},
  {"timB", "-adobe-times-bold-r-normal--*-%s0-*-*-p-*-iso8859-1"},
  {"timBI", "-adobe-times-bold-i-normal--*-%s0-*-*-p-*-iso8859-1"},
  {"helvR", "-adobe-helvetica-medium-r-normal--*-%s0-*-*-p-*-iso8859-1"},
  {"helvO", "-adobe-helvetica-medium-o-normal--*-%s0-*-*-p-*-iso8859-1"},
  {"helvB", "-adobe-helvetica-bold-r-normal--*-%s0-*-*-p-*-iso8859-1"},
  {"helvBO","-adobe-helvetica-bold-o-normal--*-%s0-*-*-p-*-iso8859-1"},
  {(char *) NULL,( char *) NULL}
}
ce qui suit marche sur 75dpi ou 100dpi

Definition at line 2162 of file periGif.c.

Referenced by loadfamily(), queryfamily(), xset_font(), and xsetfont().

int GifDashes[50] [static]

Definition at line 130 of file periGif.c.

Referenced by GifLineColor().

gdFontPtr GifFont [static]

Definition at line 129 of file periGif.c.

Referenced by boundingboxGif(), and displaystringGif().

gdImagePtr GifIm = (gdImagePtr)0 [static]

Definition at line 128 of file periGif.c.

Referenced by C2F(), clearwindowGif(), ColorInitGif(), getcolormapGif(), GifLineColor(), setalufunction1Gif(), setalufunctionGif(), setclipGif(), setcolormapGif(), setgccolormapGif(), setwindowdimGif(), unsetclipGif(), and xendgraphicGif().

int isizeGif[FONTMAXSIZE] = { 8 ,10,12,14,18,24 } [static]

Definition at line 2135 of file periGif.c.

int nGifDashes [static]

Definition at line 130 of file periGif.c.

Referenced by GifLineColor().

struct bgc ScilabGCTabGif[]

Table in lexicographic order

char* sizeGif[] = { "08" ,"10","12","14","18","24"} [static]

Definition at line 2134 of file periGif.c.

char symb_listGif[]

Initial value:

 {
  
  (char)0x2e,(char)0x2b,(char)0xb4,(char)0xc5,(char)0xa8,
  (char)0xe0,(char)0x44,(char)0xd1,(char)0xa7,(char)0x4f}

Definition at line 2236 of file periGif.c.

double* vdouble = 0 [static]

Definition at line 126 of file periGif.c.


Generated on Sun Mar 4 15:49:44 2007 for Scilab [trunk] by  doxygen 1.5.1