00001
00002 #include <Xm/Xm.h>
00003 #include <X11/StringDefs.h>
00004 #include <X11/cursorfont.h>
00005
00006 #ifndef __cplusplus
00007 #include <math.h>
00008 #endif
00009
00010 #include <string.h>
00011 #include <stdio.h>
00012 #include <fcntl.h>
00013
00014 #ifdef __cplusplus
00015 extern "C" {
00016 #endif
00017
00018
00019
00020
00021 typedef struct cbgxpmap cbgxPmap;
00022 struct cbgxpmap {
00023 Pixmap UserPmap;
00024 cbgxPmap *NextPmap;
00025 cbgxPmap *PrevPmap;
00026 };
00027
00028 typedef struct {
00029 unsigned char x;
00030 unsigned char pena;
00031 unsigned char y;
00032 unsigned char poli;
00033 } cbgxPonto;
00034
00035 typedef struct {
00036 unsigned char npto;
00037 unsigned char xmin;
00038 unsigned char xmax;
00039 unsigned char ymin;
00040 unsigned char ymax;
00041 char lixo[3];
00042 cbgxPonto *pto;
00043 } cbgxCaracter;
00044
00045 #define CBGXMOVER 0.0
00046 #define CBGXDESENHAR 1.0
00047 #define CBGXROTULAR 2.0
00048
00049 #define cbgxmax(x,y) (((x) > (y)) ? (x) : (y))
00050 #define cbgxmin(x,y) (((x) > (y)) ? (y) : (x))
00051
00052
00053
00054
00055
00056 #define CBGXREG1 1
00057
00058 #define CBGXPRIM_POL 1
00059 #define CBGXPRIM_AREA 2
00060 #define CBGXPRIM_TEXTO 3
00061
00062 typedef struct
00063 {
00064 float x, y;
00065 } cbgxXY;
00066
00067 typedef struct
00068 {
00069 short cod_simb;
00070 long n_prim;
00071 short tipo_reg;
00072 } cbgxChave_Simb;
00073
00074 typedef struct
00075 {
00076 cbgxChave_Simb chave;
00077 short tipo_prim;
00078 long nregs;
00079 } cbgxReg1;
00080
00081 typedef struct
00082 {
00083 short cor, suav, estilo, espess;
00084 } cbgxAtrib_Pol;
00085
00086 typedef struct
00087 {
00088 short tipo, codigo;
00089 int corpre, corback;
00090 short borda;
00091 int corborda;
00092 float escala, angulo;
00093 } cbgxAtrib_Area;
00094
00095
00096
00097
00098
00099 #define CBGXMAXCORES 256
00100
00101
00102 #define CBGXNCORES_VAR 180
00103
00104
00105 #define CBGXNUMCORES 16
00106
00107
00108 #define CBGXCOR_CTE_INIC 0
00109
00110
00111 #define CBGXCOR_VAR_INIC 16
00112
00113
00114 #define CBGXCOR_CIN_INIC 201
00115
00116
00117 #define CBGXCOR_PIX_INIC 23
00118
00119
00120 #define CBGXNCORES_PIX 7
00121
00122
00123
00124
00125
00126
00127 cbgxPmap *fbgxAlocaPixMap (void);
00128 void fbgxAtribPadrao (char *, int, int, Pixel, Pixel);
00129 void fbgxBezier (float *, long, float *);
00130 void fbgxCalculaAspecto (float *, long *, long *);
00131 void fbgxCalculaElipse (float, float, float, float, float *);
00132 void fbgxCalculaPolRegular (short, float, float, float, float, float,
00133 float *);
00134 void fbgxCarregaFonte (void);
00135 void fbgxCarregaFonteTt (void);
00136 void fbgxCarregaFonte1 (long);
00137 void fbgxCarregaFonte2 (void);
00138 void fbgxCarregaTabCor (void);
00139 void fbgxCarregaTabSim (void);
00140 void fbgxCheckPontos (int *, int *, int *, int *);
00141 void fbgxClearArea (float *);
00142 void fbgxClearPol (long, float *, int, int);
00143 void fbgxClearReta (float, float, float, float, int, int);
00144 void fbgxClearWindow (void);
00145 void fbgxClose (void);
00146 void fbgxCm2Pix (float, float, int *, int *);
00147 void fbgxCm2Mundo8 (double, double, double *, double *);
00148 void fbgxCriaBpoligonal (float *, float *, int);
00149 void fbgxCriaBpoligonal8 (double *, double *, int);
00150 void fbgxCriaBspline (float *, float *, int);
00151 void fbgxCriaBspline8 (double *, double *, int);
00152 Pixmap fbgxCriaPixmap (char *, int, int);
00153 void fbgxCurvaNivel (long,float *,float,short,short,float);
00154 void fbgxCurvaNivel8 (long,double *,float,short,short,float);
00155 void fbgxCurve (long, float *);
00156 void fbgxCurve8 (long, double *);
00157 void fbgxCurve1 (float *, float *, float *, float *,
00158 float *, float *, float *, float *);
00159 long fbgxConvertImgx2Img (Display *, Window, int, int, int, int, int, char *);
00160
00161 void fbgxDesabilitaMouse (void);
00162 void fbgxDesenhaLinha (int, int, int, int);
00163 void fbgxDesRubber (float, float, float, float, short);
00164 void fbgxDesSimbolo (float, float, short, float, float);
00165 void fbgxDesSimboloPoco (float, float, short, float, float, int);
00166 void fbgxDesSimboloPoco8 (double, double, short, float, float, int);
00167 void fbgxDesTextoX11 (char *, double, double, char *, double);
00168 void fbgxDesTexto (float, float, char *, float,
00169 float, float, float);
00170 void fbgxDesTextoEsp (long , float, float, char *, float,
00171 float, float, float);
00172 void fbgxDesTextoEsp8 (long , double, double, char *, float,
00173 float, float, float);
00174 void fbgxDesTxtTp (char *, float, float, char *, float,
00175 float, float, long, float, float, float);
00176 void fbgxDesTxtTp8 (char *, double, double, char *, float,
00177 float, float, long, float, float, float);
00178 void fbgxDestroiBpoligonal (void);
00179 void fbgxDestroiBpoligonal8(void);
00180 void fbgxDestroiBspline (void);
00181 void fbgxDestroiBspline8 (void);
00182 void fbgxDisPolyline (long, float *);
00183 void fbgxDisPolyline8 (long, double *);
00184 void fbgxDisjAsPolyline8 (long, double *);
00185 void fbgxPolylineWidth (long, float *, float);
00186 void fbgxEndRegion (void);
00187 void fbgxEvalBpoligonal (float,float *,float *,float *,float *);
00188 void fbgxEvalBpoligonal8 (double,double *,double *,double *,double *);
00189 void fbgxEvalBspline (float,float *,float *,float *,float *);
00190 void fbgxEvalBspline8 (double,double *,double *,double *,double *);
00191 int fbgxExecFontTastic (void);
00192 void fbgxExibePixMap (cbgxPmap *);
00193 void fbgxExibeMyPixMap(Widget, unsigned int, unsigned int,
00194 unsigned int, unsigned int, Pixmap,
00195 unsigned int, unsigned int);
00196 void fbgxFechaTabSim (void);
00197 void fbgxFimImg (void);
00198 void fbgxIndTBpoligonal (float, int *, int *);
00199 void fbgxIndTBpoligonal8 (double, int *, int *);
00200 void fbgxIndTBspline (float, int *, int *);
00201 void fbgxIndTBspline8 (double, int *, int *);
00202 void fbgxInicImg (void);
00203 void fbgxInicLinhaImg (void);
00204 void fbgxDummyLinhaImg (void);
00205 void fbgxDummyLinhaImg24b (void);
00206 void fbgxFillArea (float, float, float, long, float *);
00207 void fbgxFillArea8 (float, float, float, long, double *);
00208 void fbgxFillAreaInd (int, long, float *);
00209 void fbgxFillAreaInd8 (int, long, double *);
00210 void fbgxFillLito (short, float, float, float, float, float,
00211 long, float *);
00212 void fbgxFillLito8 (short, float, float, float, float, float,
00213 long, double *);
00214 void fbgxFillPadrao (short, short, float, float, float,
00215 long, float *);
00216 void fbgxFillPadrao8 (short, short, float, float, float,
00217 long, double *);
00218 void fbgxFillRetangulo (float, float, float, float, float,
00219 float, float);
00220 void fbgxFimLinhaImg (void);
00221 void fbgxFimLinhaImg24b (void);
00222 void fbgxFreeListTxtTp (char **);
00223 char **fbgxGetListTxtTp (char *, char *, int,int *);
00224 void fbgxGetBox (float, float, float *, float *, short *);
00225 void fbgxGetBox8 (double,double,double *,double *,short *);
00226 void fbgxGetCircle8 (double,double,double *,short *);
00227 void fbgxGetElipse8 (double,double,double *,double *,short *);
00228 void fbgxGetBoxJan (float, float, float *, float *, short *);
00229 void fbgxGetBoxJan1 (float, float, float *, float *, short *);
00230 void fbgxGetCorTab (Widget, void (*)() );
00231 void fbgxGetCorTabRgb (Widget, void (*)() );
00232 unsigned long fbgxGetIndCor (float, float, float);
00233 unsigned long fbgxGetIndCorReal (float, float, float);
00234 void fbgxGetLimitesTexto (long,float,float,char *,float,float,float,
00235 float,float *,float *,float *,float *);
00236 void fbgxGetLimitesTextoTt (char *, float, float, char *, float,
00237 float, float, long, float, float, float,
00238 int *, int *, int *, int *);
00239 void fbgxGetPto (float *, float *, short *);
00240 void fbgxGetPtoDisplay (Display *, Window, int *, int *, short *);
00241 void fbgxGetPto8 (double *, double *, short *);
00242 void fbgxGetPtoJan (float *, float *, short *);
00243 void fbgxGetPtoJan1 (float *, float *, short *);
00244 void fbgxGetPtoPoly (long, float *, float *, float *, short *);
00245 void fbgxGetPtoPoly8 (long,double *,double *,double *,short *);
00246 void fbgxGetPtoRetangulo (float, float, float, float,
00247 float *, float *, short *);
00248 void fbgxGetPtoRetangulo8 (double, double, double, double,
00249 double *, double *, short *);
00250 void fbgxGetRGBCorTab (long,float *,float *,float *);
00251 void fbgxGetRGBCor (unsigned long,float *,float *,float *);
00252 void fbgxGetRGBCorCtes (unsigned long,float *,float *,float *);
00253 void fbgxGetRealWindow (float *);
00254 void fbgxGetReta (float *, float *, float *, float *);
00255 void fbgxGetRubInterpola (float *, float *, float *, float *,
00256 short *);
00257 void fbgxGetRubInterpola8 (double *, double *, double *, double *,
00258 short *);
00259 void fbgxGetRubPto (float, float, float *, float *, short *);
00260 void fbgxGetRubPto8 (double,double,double *,double *,short *);
00261 void fbgxGetRubPtoJan (float, float, float *, float *, short *);
00262 void fbgxGetRubPtoJan1 (float, float, float *, float *, short *);
00263 void fbgxGetTBpoligonal (int, float *);
00264 void fbgxGetTBpoligonal8 (int, double *);
00265 void fbgxGetTBspline (int, float *);
00266 void fbgxGetTBspline8 (int, double *);
00267 void fbgxGetTmaxBpoligonal (float *);
00268 void fbgxGetTmaxBpoligonal8(double *);
00269 void fbgxGetTmaxBspline (float *);
00270 void fbgxGetTmaxBspline8 (double *);
00271 void fbgxGetWindowCorrente (float *);
00272 void fbgxGetDrawingCorrente(Widget *);
00273 void fbgxGetScaleCorrente (float *, float *);
00274 void fbgxGrabPointer (short);
00275 void fbgxHabilitaMouse (void);
00276 void fbgxLiberaPixMap (cbgxPmap *);
00277 void fbgxLiberaMyPixMap (Widget, Pixmap);
00278 Colormap fbgxInicCores (void);
00279 void fbgxLineAtribs (short, short, short, int);
00280 void fbgxLineColor (int);
00281 void fbgxLineColorRgb (float, float, float);
00282 void fbgxLineStyle (int);
00283 void fbgxLineWidth (int);
00284 void fbgxlit (int *, short *);
00285 long fbgxlitAgp2Big (long);
00286 long fbgxlitBig2Agp (long);
00287 void fbgxLitoCor (short, float *, float *, float *);
00288 void fbgxMenuTabCoresSaveDaApl (void);
00289 void fbgxMenuTabCoresRestDaApl (void);
00290 void fbgxMenuTabCores (Widget, long, float, float, float, long, long, long, XtPointer, void (*funcaoRet)());
00291 void fbgxMostraImg (void);
00292 void fbgxMundo2Pix (float, float, int *, int *);
00293 void fbgxMundo2Pix8 (double, double, int *, int *);
00294 void fbgxMundo2PixLong (float , float, long *, long *);
00295 void fbgxMundo2PixReal (float, float, float *, float *);
00296 void fbgxMundo2PixReal8 (double, double, float *, float *);
00297 void fbgxMundo2Cm8 (double, double, double *, double *);
00298 void fbgxMyColorMap (long, float *, float *, float *);
00299 void fbgxOnOffAspect (long);
00300 void fbgxObtemParametrosTexto (Widget, void (*)(), void (*)());
00301 void fbgxOpen (Widget);
00302 void fbgxPixelImg (int,int,int,int,long);
00303 void fbgxPixelImg24b (int,int,int,int,float,float,float);
00304 void fbgxPix2Mundo (int, int , float *, float *);
00305 void fbgxPix2Mundo8 (int, int , double *, double *);
00306 void fbgxPoint (float, float);
00307 void fbgxPolyline (long, float *);
00308 void fbgxPolyline8 (long, double *);
00309 void fbgxPosicionaCursor (float, float);
00310 void fbgxPosicionaCursor8 (double, double);
00311 int fbgxScreen (Widget);
00312 cbgxPmap *fbgxSalvaPixMap (void);
00313 void fbgxSalvaMyPixmap(Widget, unsigned int, unsigned int, Pixmap *);
00314 long fbgxSalvaImg (int, char *);
00315 void fbgxSetRGB (float , float , float );
00316 void fbgxSetCorImg (long, float *, float *, float *);
00317 void fbgxSetDeltaCorImg (long);
00318 void fbgxSetDrawingArea (Widget);
00319 void fbgxSetDrawingAreaScreen (Widget, int);
00320 void fbgxSetExibicaoImg (long);
00321 void fbgxSetFontPath (char *);
00322 void fbgxSetMyPmap (long, Pixmap *);
00323 void fbgxSetMotionCoord (void (*)());
00324 void fbgxSetKeyPress (void (*)());
00325 void fbgxSetParmGetPtoJan (long, long, cbgxPmap *);
00326 void fbgxSetRegion (float *);
00327 void fbgxSetScale (float, float);
00328 void fbgxSetUnitOrig (void);
00329 void fbgxSetUnitValor (double);
00330 void fbgxStrip (cbgxPmap *);
00331 void fbgxWindow (float *);
00332 void fbgxWindow2View (float *, long *);
00333 void fbgxXDrawLine (Display *,Window,GC,int,int,int,int);
00334 void fbgxXDrawLines (Display *,Window,GC,XPoint *,int,int);
00335 void fbgxXDrawRectangle (Display *,Window,GC,int,int,int,int);
00336 void fbgxXFillRectangle (Display *,Window,GC,int,int,int,int);
00337 void fbgxXFillPolygon (Display *,Window,GC,XPoint *,int,int,int);
00338 void fbgxXDrawCircle (Display *,Window,GC,int,int,int);
00339 void fbgxXDrawElipse (Display *,Window,GC,int,int,int,int);
00340 void fbgxZoomLocal (Widget, Widget,cbgxPmap *,void (*F)());
00341 void fbgxSetRubberEsp (int);
00342 void fbgxDesTextoEsp8Coord (long, double, double, char *, float,
00343 float, float, float, long *, float *);
00344
00345
00346 void decas_d (int, double *, double, double *, double *);
00347 void parameters (double *, double *, int, double *);
00348 void set_up_system (double *, int, double *, double *, double *);
00349 void l_u_system (double *, double *, double *, int, double *, double *);
00350 void bessel_ends (double *, double *, int, double *, double *);
00351 void bspline_to_bezier (double *, double *, int, double *);
00352 void solve_system (double *, double *, double *, int, double *, double *);
00353
00354 #ifdef __cplusplus
00355 }
00356 #endif
00357