00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include <stdio.h>
00015 #include <string.h>
00016 #include <math.h>
00017 #include <stdlib.h>
00018 #include <stdarg.h>
00019 #include <time.h>
00020
00021 #include "GetProperty.h"
00022 #include "bcg.h"
00023 #include "BuildObjects.h"
00024 #include "SetProperty.h"
00025 #include "Xcall1.h"
00026 #include "WindowList.h"
00027 #include "sciprint.h"
00028 #include "PloEch.h"
00029 #include "../../gui/includes/GraphicWindow.h"
00030 #include "CurrentObjectsManagement.h"
00031 #include "ObjectSelection.h"
00032
00033 #include "MALLOC.h"
00034
00035
00036 extern sciHandleTab *PENDOFHANDLETAB;
00037
00038 extern sciPointObj *pfiguremdl;
00039 extern sciPointObj *paxesmdl;
00040
00041 extern int cf_type;
00042
00043
00047 void *
00048 sciGetPointerToFeature (sciPointObj * pobj)
00049 {
00050
00051
00052 switch (sciGetEntityType (pobj))
00053 {
00054 case SCI_FIGURE:
00055 return (sciFigure *) pFIGURE_FEATURE (pobj);
00056 break;
00057 case SCI_SUBWIN:
00058 return (sciSubWindow *) pSUBWIN_FEATURE (pobj);
00059 break;
00060 case SCI_TEXT:
00061 return (sciText *) pTEXT_FEATURE (pobj);
00062 break;
00063 case SCI_TITLE:
00064 return (sciTitle *) pTITLE_FEATURE (pobj);
00065 break;
00066 case SCI_LEGEND:
00067 return (sciLegend *) pLEGEND_FEATURE (pobj);
00068 break;
00069 case SCI_ARC:
00070 return (sciArc *) pARC_FEATURE (pobj);
00071 break;
00072 case SCI_POLYLINE:
00073 return (sciPolyline *) pPOLYLINE_FEATURE (pobj);
00074 break;
00075 case SCI_SEGS:
00076 return (sciSegs *) pSEGS_FEATURE (pobj);
00077 break;
00078 case SCI_FEC:
00079 return (sciFec *) pFEC_FEATURE (pobj);
00080 break;
00081 case SCI_GRAYPLOT:
00082 return (sciGrayplot *) pGRAYPLOT_FEATURE (pobj);
00083 break;
00084 case SCI_RECTANGLE:
00085 return (sciRectangle *) pRECTANGLE_FEATURE (pobj);
00086 break;
00087 case SCI_SURFACE:
00088 return (sciSurface *) pSURFACE_FEATURE (pobj);
00089 break;
00090 case SCI_LIGHT:
00091 return (sciLightSource *) pLIGHT_FEATURE (pobj);
00092 break;
00093 case SCI_AXES:
00094 return (sciAxes *) pAXES_FEATURE (pobj);
00095 break;
00096 case SCI_PANNER:
00097 return (sciPanner *) pPANNER_FEATURE (pobj);
00098 break;
00099 case SCI_SBH:
00100 return (sciScrollBarHorz *) pSBH_FEATURE (pobj);
00101 break;
00102 case SCI_SBV:
00103 return (sciScrollBarVert *) pSBV_FEATURE (pobj);
00104 break;
00105 case SCI_MENU:
00106 return (sciMenu *) pMENU_FEATURE (pobj);
00107 break;
00108 case SCI_MENUCONTEXT:
00109 return (sciMenuContext *) pMENUCONTEXT_FEATURE (pobj);
00110 break;
00111 case SCI_STATUSB:
00112 return (sciStatusBar *) pSTATUSB_FEATURE (pobj);
00113 break;
00114 case SCI_AGREG:
00115 return (sciAgreg *) pAGREG_FEATURE (pobj);
00116 break;
00117 case SCI_MERGE:
00118 return (sciMerge *) pMERGE_FEATURE (pobj);
00119 break;
00120 case SCI_LABEL:
00121 return (sciLabel *) pLABEL_FEATURE (pobj);
00122 break;
00123 case SCI_UIMENU:
00124 return (sciUimenu *) pUIMENU_FEATURE (pobj);
00125 break;
00126 default:
00127 return (void *) NULL;
00128 break;
00129 }
00130 return (void *) NULL;
00131 }
00132
00133
00134
00138 sciEntityType
00139 sciGetEntityType (sciPointObj * pobj)
00140 {
00141 if (pobj != (sciPointObj *) NULL)
00142 return pobj->entitytype;
00143 return (sciEntityType)-1;
00144 }
00145
00146
00150 char *
00151 sciGetCharEntityType (sciPointObj * pobj)
00152 {
00153
00154 switch (sciGetEntityType (pobj))
00155 {
00156 case SCI_FIGURE:
00157 return "Figure";
00158 break;
00159 case SCI_SUBWIN:
00160 return "Axes";
00161 break;
00162 case SCI_TEXT:
00163 return "Text";
00164 break;
00165 case SCI_TITLE:
00166 return "Title";
00167 break;
00168 case SCI_LEGEND:
00169 return "Legend";
00170 break;
00171 case SCI_ARC:
00172 return "Arc";
00173 break;
00174 case SCI_POLYLINE:
00175 return "Polyline";
00176 break;
00177 case SCI_SEGS:
00178 return (pSEGS_FEATURE (pobj)->ptype == 0) ? "Segs": "Champ";
00179 break;
00180 case SCI_FEC:
00181 return "Fec";
00182 break;
00183 case SCI_GRAYPLOT:
00184 return (pGRAYPLOT_FEATURE (pobj)->type ==0) ? "Grayplot":"Matplot";
00185 break;
00186 case SCI_RECTANGLE:
00187 return "Rectangle";
00188 break;
00189 case SCI_SURFACE:
00190 switch (pSURFACE_FEATURE (pobj)->typeof3d)
00191 {
00192 case SCI_FAC3D:
00193 return "Fac3d";
00194 break;
00195 case SCI_PLOT3D:
00196 return "Plot3d";
00197 break;
00198 case SCI_CONTOUR:
00199 default:
00200 break;
00201 }
00202 break;
00203 case SCI_LIGHT:
00204 return "Light";
00205 break;
00206 case SCI_AXES:
00207 return "Axis";
00208 break;
00209 case SCI_PANNER:
00210 return "Panner";
00211 break;
00212 case SCI_SBH:
00213 return "Scollbar_hor";
00214 break;
00215 case SCI_SBV:
00216 return "Scollbar_ver";
00217 break;
00218 case SCI_MENU:
00219 return "Menu";
00220 break;
00221 case SCI_MENUCONTEXT:
00222 return "Contexte";
00223 break;
00224 case SCI_STATUSB:
00225 return "Statut_bar";
00226 break;
00227 case SCI_AGREG:
00228 return "Compound";
00229 break;
00230 case SCI_MERGE:
00231 return "Merge";
00232 break;
00233 case SCI_LABEL:
00234 return "Label";
00235 break;
00236 case SCI_UIMENU:
00237 return "Uimenu";
00238 break;
00239 case SCI_CONSOLE:
00240 return "Console" ;
00241 break ;
00242 case SCI_FRAME:
00243 return "Frame" ;
00244 break ;
00245 case SCI_WINDOW:
00246 return "Window" ;
00247 break ;
00248 case SCI_WINDOWFRAME:
00249 return "WindowFrame" ;
00250 break ;
00251 case SCI_SCREEN:
00252 return "Screen" ;
00253 break ;
00254 default:
00255 return (char *)NULL;
00256 break;
00257 }
00258 return (char *)NULL;
00259 }
00260
00261
00265 sciGraphicContext *
00266 sciGetGraphicContext (sciPointObj * pobj)
00267 {
00268 switch (sciGetEntityType (pobj))
00269 {
00270 case SCI_FIGURE:
00271 return &(pFIGURE_FEATURE (pobj)->graphiccontext);
00272 break;
00273 case SCI_SUBWIN:
00274 return &(pSUBWIN_FEATURE (pobj)->graphiccontext);
00275 break;
00276 case SCI_ARC:
00277 return &(pARC_FEATURE (pobj)->graphiccontext);
00278 break;
00279 case SCI_SEGS:
00280 return &(pSEGS_FEATURE (pobj)->graphiccontext);
00281 break;
00282 case SCI_FEC:
00283 return &(pFEC_FEATURE (pobj)->graphiccontext);
00284 break;
00285 case SCI_GRAYPLOT:
00286 return &(pGRAYPLOT_FEATURE (pobj)->graphiccontext);
00287 break;
00288 case SCI_POLYLINE:
00289 return &(pPOLYLINE_FEATURE (pobj)->graphiccontext);
00290 break;
00291 case SCI_RECTANGLE:
00292 return &(pRECTANGLE_FEATURE (pobj)->graphiccontext);
00293 break;
00294 case SCI_SURFACE:
00295 return &(pSURFACE_FEATURE (pobj)->graphiccontext);
00296 break;
00297 case SCI_LIGHT:
00298 return &(pLIGHT_FEATURE (pobj)->graphiccontext);
00299 break;
00300 case SCI_AXES:
00301 return &(pAXES_FEATURE (pobj)->graphiccontext);
00302 break;
00303 case SCI_MENU:
00304 return &(pMENU_FEATURE (pobj)->graphiccontext);
00305 break;
00306 case SCI_MENUCONTEXT:
00307 return &(pMENUCONTEXT_FEATURE (pobj)->graphiccontext);
00308 break;
00309 case SCI_STATUSB:
00310 return &(pSTATUSB_FEATURE (pobj)->graphiccontext);
00311 break;
00312 case SCI_LEGEND:
00313 return &(pLEGEND_FEATURE (pobj)->graphiccontext);
00314 break;
00315 case SCI_TEXT:
00316 return &(pTEXT_FEATURE (pobj)->graphiccontext);
00317 break;
00318 case SCI_LABEL:
00319 return sciGetGraphicContext( pLABEL_FEATURE(pobj)->text );
00320 case SCI_AGREG:
00321 case SCI_TITLE:
00322 case SCI_PANNER:
00323 case SCI_SBH:
00324 case SCI_SBV:
00325 case SCI_UIMENU:
00326 default:
00327 return (sciGraphicContext *) NULL;
00328 break;
00329 }
00330 return (sciGraphicContext *) NULL;
00331 }
00332
00333
00337 int
00338 sciGetNumColors (sciPointObj * pobj)
00339 {
00340
00341 switch (sciGetEntityType (pobj))
00342 {
00343 case SCI_FIGURE:
00344 return pFIGURE_FEATURE (pobj)->numcolors ;
00345 default:
00346 return sciGetNumColors( sciGetParentFigure( pobj ) ) ;
00347 }
00348 return -1 ;
00349 }
00350
00351
00357 int
00358 sciGetColormap (sciPointObj * pobj, double *rgbmat)
00359 {
00360 int i;
00361 int m = sciGetNumColors (pobj);
00362
00363 for ( i = 0 ; i < 3 * m ; i++ )
00364 {
00365 rgbmat[i] = pFIGURE_FEATURE(pobj)->pcolormap[i] ;
00366 }
00367 return 0 ;
00368 }
00369
00370
00371 int sciGetGoodIndex(sciPointObj * pobj, int colorindex)
00372 {
00373 int m = sciGetNumColors (pobj);
00374
00375 if(colorindex == -1)
00376 return m+1;
00377 else if(colorindex == -2)
00378 return m+1 +1;
00379 else
00380 return colorindex;
00381 }
00382
00383
00384
00388 int
00389 sciGetForeground (sciPointObj * pobj)
00390 {
00391
00392 int colorindex = -999;
00393
00395 switch (sciGetEntityType (pobj))
00396 {
00397 case SCI_FIGURE:
00399 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00400 break;
00401 case SCI_SUBWIN:
00402 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00403 break;
00404 case SCI_TEXT:
00405 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00406 break;
00407 case SCI_TITLE:
00408 colorindex = (sciGetFontContext(pobj))->foregroundcolor + 1;
00409 break;
00410 case SCI_LEGEND:
00411 colorindex = (sciGetFontContext(pobj))->foregroundcolor + 1;
00412 break;
00413 case SCI_ARC:
00414 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00415 break;
00416 case SCI_POLYLINE:
00417 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00418 break;
00419 case SCI_RECTANGLE:
00420 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00421 break;
00422 case SCI_SURFACE:
00423 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00424 break;
00425 case SCI_LIGHT:
00426 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00427 break;
00428 case SCI_AXES:
00429 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00430 break;
00431 case SCI_MENU:
00432 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00433 break;
00434 case SCI_MENUCONTEXT:
00435 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00436 break;
00437 case SCI_STATUSB:
00438 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00439 break;
00440 case SCI_LABEL:
00441 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00442 break;
00443 case SCI_SEGS:
00444 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00445 break;
00446 case SCI_UIMENU:
00447 case SCI_FEC:
00448 case SCI_GRAYPLOT:
00449 case SCI_AGREG:
00450 case SCI_PANNER:
00451 case SCI_SBH:
00452 case SCI_SBV:
00453 default:
00454 break;
00455 }
00456
00457 colorindex = sciGetGoodIndex(pobj, colorindex);
00458
00459 return colorindex;
00460 }
00461
00462
00463 int
00464 sciGetForegroundToDisplay (sciPointObj * pobj)
00465 {
00466
00467 int colorindex = -999;
00468 int m = sciGetNumColors(pobj);
00469
00471 switch (sciGetEntityType (pobj))
00472 {
00473 case SCI_FIGURE:
00475 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00476 break;
00477 case SCI_SUBWIN:
00478 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00479 break;
00480 case SCI_TEXT:
00481 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00482 break;
00483 case SCI_TITLE:
00484 colorindex = (sciGetFontContext(pobj))->foregroundcolor + 1;
00485 break;
00486 case SCI_LEGEND:
00487 colorindex = (sciGetFontContext(pobj))->foregroundcolor + 1;
00488 break;
00489 case SCI_ARC:
00490 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00491 break;
00492 case SCI_POLYLINE:
00493 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00494 break;
00495 case SCI_RECTANGLE:
00496 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00497 break;
00498 case SCI_SURFACE:
00499 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00500 break;
00501 case SCI_LIGHT:
00502 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00503 break;
00504 case SCI_AXES:
00505 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00506 break;
00507 case SCI_MENU:
00508 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00509 break;
00510 case SCI_MENUCONTEXT:
00511 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00512 break;
00513 case SCI_STATUSB:
00514 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00515 break;
00516 case SCI_LABEL:
00517 colorindex = (sciGetGraphicContext(pobj))->foregroundcolor + 1;
00518 break;
00519 case SCI_UIMENU:
00520 case SCI_SEGS:
00521 case SCI_FEC:
00522 case SCI_GRAYPLOT:
00523 case SCI_AGREG:
00524 case SCI_PANNER:
00525 case SCI_SBH:
00526 case SCI_SBV:
00527 default:
00528 sciprint ("\r\nNo Foreground is associated with this Entity");
00529 return -1;
00530 break;
00531 }
00532 colorindex = sciGetGoodIndex(pobj, colorindex);
00533
00534 if((m - colorindex == -1) || (m - colorindex == -2)) colorindex = m - colorindex;
00535
00536 return colorindex;
00537 }
00538
00539
00544 int
00545 sciGetBackground (sciPointObj * pobj)
00546 {
00547
00548 int colorindex = -999;
00549
00550 switch (sciGetEntityType (pobj))
00551 {
00552 case SCI_FIGURE:
00558 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00559 break;
00560 case SCI_SUBWIN:
00561 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00562 break;
00563 case SCI_TEXT:
00564 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00565 break;
00566 case SCI_TITLE:
00567 colorindex = (sciGetFontContext(pobj))->backgroundcolor + 1;
00568 break;
00569 case SCI_LEGEND:
00570 colorindex = (sciGetFontContext(pobj))->backgroundcolor + 1;
00571 break;
00572 case SCI_ARC:
00573 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00574 break;
00575 case SCI_POLYLINE:
00576 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00577 break;
00578 case SCI_RECTANGLE:
00579 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00580 break;
00581 case SCI_SURFACE:
00582 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00583 break;
00584 case SCI_LIGHT:
00585 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00586 break;
00587 case SCI_AXES:
00588 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00589 break;
00590 case SCI_PANNER:
00591 break;
00592 case SCI_SBH:
00593 break;
00594 case SCI_SBV:
00595 break;
00596 case SCI_MENU:
00597 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00598 break;
00599 case SCI_MENUCONTEXT:
00600 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00601 break;
00602 case SCI_STATUSB:
00603 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00604 break;
00605 case SCI_LABEL:
00606 colorindex = (sciGetFontContext(pobj))->backgroundcolor + 1;
00607 break;
00608 case SCI_SEGS:
00609 case SCI_FEC:
00610 case SCI_GRAYPLOT:
00611 case SCI_AGREG:
00612 case SCI_UIMENU:
00613 default:
00614 break;
00615 }
00616
00617 colorindex = sciGetGoodIndex(pobj, colorindex);
00618
00619 return colorindex;
00620 }
00621
00622
00623
00624
00625
00626 int
00627 sciGetBackgroundToDisplay (sciPointObj * pobj)
00628 {
00629
00630 int colorindex = -999;
00631 int m = sciGetNumColors(pobj);
00632
00633 switch (sciGetEntityType (pobj))
00634 {
00635 case SCI_FIGURE:
00641 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00642 break;
00643 case SCI_SUBWIN:
00644 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00645 break;
00646 case SCI_TEXT:
00647 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00648 break;
00649 case SCI_TITLE:
00650 colorindex = (sciGetFontContext(pobj))->backgroundcolor + 1;
00651 break;
00652 case SCI_LEGEND:
00653 colorindex = (sciGetFontContext(pobj))->backgroundcolor + 1;
00654 break;
00655 case SCI_ARC:
00656 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00657 break;
00658 case SCI_POLYLINE:
00659 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00660 break;
00661 case SCI_RECTANGLE:
00662 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00663 break;
00664 case SCI_SURFACE:
00665 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00666 break;
00667 case SCI_LIGHT:
00668 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00669 break;
00670 case SCI_AXES:
00671 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00672 break;
00673 case SCI_MENU:
00674 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00675 break;
00676 case SCI_MENUCONTEXT:
00677 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00678 break;
00679 case SCI_STATUSB:
00680 colorindex = (sciGetGraphicContext(pobj))->backgroundcolor + 1;
00681 break;
00682 case SCI_LABEL:
00683 colorindex = (sciGetFontContext(pobj))->backgroundcolor + 1;
00684 break;
00685 case SCI_PANNER:
00686 case SCI_SBH:
00687 case SCI_SBV:
00688 case SCI_SEGS:
00689 case SCI_FEC:
00690 case SCI_GRAYPLOT:
00691 case SCI_AGREG:
00692 case SCI_UIMENU:
00693 default:
00694 sciprint ("\r\nNo Background is associated with this Entity");
00695 return -1;
00696 break;
00697 }
00698
00699 colorindex = sciGetGoodIndex(pobj, colorindex);
00700
00701 if((m - colorindex == -1) || (m - colorindex == -2)) colorindex = m - colorindex;
00702
00703 return colorindex;
00704 }
00705
00706
00710 int
00711 sciGetMarkForeground (sciPointObj * pobj)
00712 {
00713
00714 int colorindex = -999;
00715
00717 switch (sciGetEntityType (pobj))
00718 {
00719 case SCI_FIGURE:
00721 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00722 break;
00723 case SCI_SUBWIN:
00724 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00725 break;
00726 case SCI_LEGEND:
00727 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00728 break;
00729 case SCI_ARC:
00730 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00731 break;
00732 case SCI_POLYLINE:
00733 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00734 break;
00735 case SCI_RECTANGLE:
00736 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00737 break;
00738 case SCI_SURFACE:
00739 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00740 break;
00741 case SCI_AXES:
00742 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00743 break;
00744 case SCI_SEGS:
00745 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00746 break;
00747 case SCI_MENUCONTEXT:
00748 case SCI_STATUSB:
00749 case SCI_MENU:
00750 case SCI_LIGHT:
00751 case SCI_LABEL:
00752 case SCI_TITLE:
00753 case SCI_TEXT:
00754 case SCI_FEC:
00755 case SCI_GRAYPLOT:
00756 case SCI_AGREG:
00757 case SCI_PANNER:
00758 case SCI_SBH:
00759 case SCI_SBV:
00760 case SCI_UIMENU:
00761 default:
00762 break;
00763 }
00764
00765 colorindex = sciGetGoodIndex(pobj, colorindex);
00766
00767 return colorindex;
00768 }
00769
00770
00771 int
00772 sciGetMarkForegroundToDisplay (sciPointObj * pobj)
00773 {
00774
00775 int colorindex = -999;
00776 int m = sciGetNumColors(pobj);
00777
00779 switch (sciGetEntityType (pobj))
00780 {
00781 case SCI_FIGURE:
00783 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00784 break;
00785 case SCI_SUBWIN:
00786 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00787 break;
00788 case SCI_LEGEND:
00789 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00790 break;
00791 case SCI_ARC:
00792 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00793 break;
00794 case SCI_POLYLINE:
00795 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00796 break;
00797 case SCI_RECTANGLE:
00798 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00799 break;
00800 case SCI_SURFACE:
00801 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00802 break;
00803 case SCI_AXES:
00804 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00805 break;
00806 case SCI_SEGS:
00807 colorindex = (sciGetGraphicContext(pobj))->markforeground + 1;
00808 break;
00809 case SCI_MENUCONTEXT:
00810 case SCI_STATUSB:
00811 case SCI_MENU:
00812 case SCI_LIGHT:
00813 case SCI_LABEL:
00814 case SCI_TITLE:
00815 case SCI_TEXT:
00816 case SCI_FEC:
00817 case SCI_GRAYPLOT:
00818 case SCI_AGREG:
00819 case SCI_PANNER:
00820 case SCI_SBH:
00821 case SCI_SBV:
00822 case SCI_UIMENU:
00823 default:
00824 sciprint ("\r\nNo Mark Foreground is associated with this Entity");
00825 return -1;
00826 break;
00827 }
00828
00829 colorindex = sciGetGoodIndex(pobj, colorindex);
00830
00831 if((m - colorindex == -1) || (m - colorindex == -2)) colorindex = m - colorindex;
00832
00833 return colorindex;
00834 }
00835
00836
00837
00842 int
00843 sciGetMarkBackground (sciPointObj * pobj)
00844 {
00845
00846 int colorindex = -999;
00847
00848 switch (sciGetEntityType (pobj))
00849 {
00850 case SCI_FIGURE:
00852 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00853 break;
00854 case SCI_SUBWIN:
00855 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00856 break;
00857 case SCI_LEGEND:
00858 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00859 break;
00860 case SCI_ARC:
00861 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00862 break;
00863 case SCI_POLYLINE:
00864 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00865 break;
00866 case SCI_RECTANGLE:
00867 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00868 break;
00869 case SCI_SURFACE:
00870 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00871 break;
00872 case SCI_AXES:
00873 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00874 break;
00875 case SCI_SEGS:
00876 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00877 break;
00878 case SCI_MENUCONTEXT:
00879 case SCI_STATUSB:
00880 case SCI_MENU:
00881 case SCI_LIGHT:
00882 case SCI_LABEL:
00883 case SCI_UIMENU:
00884 case SCI_TITLE:
00885 case SCI_TEXT:
00886 case SCI_FEC:
00887 case SCI_GRAYPLOT:
00888 case SCI_AGREG:
00889 case SCI_PANNER:
00890 case SCI_SBH:
00891 case SCI_SBV:
00892 default:
00893 break;
00894 }
00895
00896 colorindex = sciGetGoodIndex(pobj, colorindex);
00897
00898 return colorindex;
00899 }
00900
00901
00902
00903
00904
00905 int
00906 sciGetMarkBackgroundToDisplay (sciPointObj * pobj)
00907 {
00908
00909 int colorindex = -999;
00910 int m = sciGetNumColors(pobj);
00911
00912 switch (sciGetEntityType (pobj))
00913 {
00914 case SCI_FIGURE:
00916 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00917 break;
00918 case SCI_SUBWIN:
00919 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00920 break;
00921 case SCI_LEGEND:
00922 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00923 break;
00924 case SCI_ARC:
00925 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00926 break;
00927 case SCI_POLYLINE:
00928 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00929 break;
00930 case SCI_RECTANGLE:
00931 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00932 break;
00933 case SCI_SURFACE:
00934 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00935 break;
00936 case SCI_AXES:
00937 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00938 break;
00939 case SCI_SEGS:
00940 colorindex = (sciGetGraphicContext(pobj))->markbackground + 1;
00941 break;
00942 case SCI_MENUCONTEXT:
00943 case SCI_STATUSB:
00944 case SCI_MENU:
00945 case SCI_LIGHT:
00946 case SCI_LABEL:
00947 case SCI_UIMENU:
00948 case SCI_TITLE:
00949 case SCI_TEXT:
00950 case SCI_FEC:
00951 case SCI_GRAYPLOT:
00952 case SCI_AGREG:
00953 case SCI_PANNER:
00954 case SCI_SBH:
00955 case SCI_SBV:
00956 default:
00957 sciprint ("\r\nNo Mark Background is associated with this Entity");
00958 return -1;
00959 break;
00960 }
00961
00962 colorindex = sciGetGoodIndex(pobj, colorindex);
00963
00964 if((m - colorindex == -1) || (m - colorindex == -2)) colorindex = m - colorindex;
00965
00966 return colorindex;
00967 }
00968
00969
00973 int
00974 sciGetLineWidth (sciPointObj * pobj)
00975 {
00976 switch (sciGetEntityType (pobj))
00977 {
00978 case SCI_FIGURE:
00979 return (sciGetGraphicContext(pobj))->linewidth;
00980 break;
00981 case SCI_SUBWIN:
00982 return (sciGetGraphicContext(pobj))->linewidth;
00983 break;
00984 case SCI_TEXT:
00985 return 0;
00986 break;
00987 case SCI_TITLE:
00988 return 0;
00989 break;
00990 case SCI_LEGEND:
00991 return 0;
00992 break;
00993 case SCI_ARC:
00994 return (sciGetGraphicContext(pobj))->linewidth;
00995 break;
00996 case SCI_POLYLINE:
00997 return (sciGetGraphicContext(pobj))->linewidth;
00998 break;
00999 case SCI_RECTANGLE:
01000 return (sciGetGraphicContext(pobj))->linewidth;
01001 break;
01002 case SCI_SURFACE:
01003 return (sciGetGraphicContext(pobj))->linewidth;
01004 break;
01005 case SCI_LIGHT:
01006 return (sciGetGraphicContext(pobj))->linewidth;
01007 break;
01008 case SCI_AXES:
01009 return (sciGetGraphicContext(pobj))->linewidth;
01010 break;
01011 case SCI_MENU:
01012 return (sciGetGraphicContext(pobj))->linewidth;
01013 break;
01014 case SCI_MENUCONTEXT:
01015 return (sciGetGraphicContext(pobj))->linewidth;
01016 break;
01017 case SCI_STATUSB:
01018 return (sciGetGraphicContext(pobj))->linewidth;
01019 break;
01020 case SCI_SEGS:
01021 return (sciGetGraphicContext(pobj))->linewidth;
01022 break;
01023 case SCI_FEC:
01024 case SCI_GRAYPLOT:
01025 case SCI_PANNER:
01026 case SCI_SBH:
01027 case SCI_SBV:
01028 case SCI_AGREG:
01029 case SCI_LABEL:
01030 case SCI_UIMENU:
01031 default:
01032 sciprint ("This object has no Line Width\n");
01033 return -1;
01034 break;
01035 }
01036 return -1;
01037 }
01038
01039
01043 int
01044 sciGetLineStyle (sciPointObj * pobj)
01045 {
01046 switch (sciGetEntityType (pobj))
01047 {
01048 case SCI_FIGURE:
01049 return (sciGetGraphicContext(pobj))->linestyle;
01050 break;
01051 case SCI_SUBWIN:
01052 return (sciGetGraphicContext(pobj))->linestyle;
01053 break;
01054 case SCI_ARC:
01055 return (sciGetGraphicContext(pobj))->linestyle;
01056 break;
01057 case SCI_POLYLINE:
01058 return (sciGetGraphicContext(pobj))->linestyle;
01059 break;
01060 case SCI_RECTANGLE:
01061 return (sciGetGraphicContext(pobj))->linestyle;
01062 break;
01063 case SCI_SURFACE:
01064 return (sciGetGraphicContext(pobj))->linestyle;
01065 break;
01066 case SCI_LIGHT:
01067 return (sciGetGraphicContext(pobj))->linestyle;
01068 break;
01069 case SCI_AXES:
01070 return (sciGetGraphicContext(pobj))->linestyle;
01071 break;
01072 case SCI_MENU:
01073 return (sciGetGraphicContext(pobj))->linestyle;
01074 break;
01075 case SCI_MENUCONTEXT:
01076 return (sciGetGraphicContext(pobj))->linestyle;
01077 break;
01078 case SCI_STATUSB:
01079 return (sciGetGraphicContext(pobj))->linestyle;
01080 break;
01081 case SCI_SEGS:
01082 return (sciGetGraphicContext(pobj))->linestyle;
01083 break;
01084 case SCI_FEC:
01085 case SCI_GRAYPLOT:
01086 case SCI_PANNER:
01087 case SCI_SBH:
01088 case SCI_SBV:
01089 case SCI_AGREG:
01090 case SCI_TEXT:
01091 case SCI_TITLE:
01092 case SCI_LEGEND:
01093 case SCI_LABEL:
01094 case SCI_UIMENU:
01095 default:
01096 sciprint ("This object has no Line Style\n");
01097 return -1;
01098 break;
01099 }
01100 return 0;
01101 }
01102
01103
01107 BOOL
01108 sciGetIsMark (sciPointObj * pobj)
01109 {
01110 switch (sciGetEntityType (pobj))
01111 {
01112 case SCI_FIGURE:
01113 return (sciGetGraphicContext(pobj))->ismark;
01114 break;
01115 case SCI_SUBWIN:
01116 return (sciGetGraphicContext(pobj))->ismark;
01117 break;
01118 case SCI_ARC:
01119 return (sciGetGraphicContext(pobj))->ismark;
01120 break;
01121 case SCI_POLYLINE:
01122 return (sciGetGraphicContext(pobj))->ismark;
01123 break;
01124 case SCI_RECTANGLE:
01125 return (sciGetGraphicContext(pobj))->ismark;
01126 break;
01127 case SCI_SURFACE:
01128 return (sciGetGraphicContext(pobj))->ismark;
01129 break;
01130 case SCI_AXES:
01131 return (sciGetGraphicContext(pobj))->ismark;
01132 break;
01133 case SCI_SEGS:
01134 return (sciGetGraphicContext(pobj))->ismark;
01135 break;
01136 case SCI_LEGEND:
01137 return (sciGetGraphicContext(pobj))->ismark;
01138 break;
01139 case SCI_FEC:
01140 case SCI_GRAYPLOT:
01141 case SCI_LIGHT:
01142 case SCI_MENU:
01143 case SCI_MENUCONTEXT:
01144 case SCI_STATUSB:
01145 case SCI_PANNER:
01146 case SCI_SBH:
01147 case SCI_SBV:
01148 case SCI_AGREG:
01149 case SCI_TEXT:
01150 case SCI_TITLE:
01151 case SCI_LABEL:
01152 case SCI_UIMENU:
01153 default:
01154
01155 return FALSE;
01156 break;
01157 }
01158 return 0;
01159 }
01160
01161
01165 int
01166 sciGetMarkStyle (sciPointObj * pobj)
01167 {
01168 switch (sciGetEntityType (pobj))
01169 {
01170 case SCI_FIGURE:
01171 return (sciGetGraphicContext(pobj))->markstyle;
01172 break;
01173 case SCI_SUBWIN:
01174
01175 return (sciGetGraphicContext(pobj))->markstyle;
01176 break;
01177 case SCI_ARC:
01178 return (sciGetGraphicContext(pobj))->markstyle;
01179 break;
01180 case SCI_POLYLINE:
01181 return (sciGetGraphicContext(pobj))->markstyle;
01182 break;
01183 case SCI_RECTANGLE:
01184 return (sciGetGraphicContext(pobj))->markstyle;
01185 break;
01186 case SCI_SURFACE:
01187 return (sciGetGraphicContext(pobj))->markstyle;
01188 break;
01189 case SCI_AXES:
01190 return (sciGetGraphicContext(pobj))->markstyle;
01191 break;
01192 case SCI_SEGS:
01193 return (sciGetGraphicContext(pobj))->markstyle;
01194 break;
01195 case SCI_LEGEND:
01196 return (sciGetGraphicContext(pobj))->markstyle;
01197 break;
01198 case SCI_FEC:
01199 case SCI_GRAYPLOT:
01200 case SCI_LIGHT:
01201 case SCI_MENU:
01202 case SCI_MENUCONTEXT:
01203 case SCI_STATUSB:
01204 case SCI_PANNER:
01205 case SCI_SBH:
01206 case SCI_SBV:
01207 case SCI_AGREG:
01208 case SCI_TEXT:
01209 case SCI_TITLE:
01210 case SCI_LABEL:
01211 case SCI_UIMENU:
01212 default:
01213 return -1;
01214 break;
01215 }
01216 return 0;
01217 }
01218
01219
01220
01224 int
01225 sciGetMarkSize (sciPointObj * pobj)
01226 {
01227 switch (sciGetEntityType (pobj))
01228 {
01229 case SCI_FIGURE:
01230 return (sciGetGraphicContext(pobj))->marksize;
01231 break;
01232 case SCI_SUBWIN:
01233 return (sciGetGraphicContext(pobj))->marksize;
01234 break;
01235 case SCI_ARC:
01236 return (sciGetGraphicContext(pobj))->marksize;
01237 break;
01238 case SCI_POLYLINE:
01239 return (sciGetGraphicContext(pobj))->marksize;
01240 break;
01241 case SCI_RECTANGLE:
01242 return (sciGetGraphicContext(pobj))->marksize;
01243 break;
01244 case SCI_SURFACE:
01245 return (sciGetGraphicContext(pobj))->marksize;
01246 break;
01247 case SCI_AXES:
01248 return (sciGetGraphicContext(pobj))->marksize;
01249 break;
01250 case SCI_SEGS:
01251 return (sciGetGraphicContext(pobj))->marksize;
01252 break;
01253 case SCI_LEGEND:
01254 return (sciGetGraphicContext(pobj))->marksize;
01255 break;
01256 case SCI_FEC:
01257 case SCI_GRAYPLOT:
01258 case SCI_LIGHT:
01259 case SCI_MENU:
01260 case SCI_MENUCONTEXT:
01261 case SCI_STATUSB:
01262 case SCI_PANNER:
01263 case SCI_SBH:
01264 case SCI_SBV:
01265 case SCI_AGREG:
01266 case SCI_TEXT:
01267 case SCI_TITLE:
01268 case SCI_LABEL:
01269 case SCI_UIMENU:
01270 default:
01271 return -1;
01272 break;
01273 }
01274 return 0;
01275 }
01276
01277
01282 int
01283 sciGetMarkSizeUnit (sciPointObj * pobj)
01284 {
01285 switch (sciGetEntityType (pobj))
01286 {
01287 case SCI_FIGURE:
01288 return (sciGetGraphicContext(pobj))->marksizeunit;
01289 break;
01290 case SCI_SUBWIN:
01291 return (sciGetGraphicContext(pobj))->marksizeunit;
01292 break;
01293 case SCI_ARC:
01294 return (sciGetGraphicContext(pobj))->marksizeunit;
01295 break;
01296 case SCI_POLYLINE:
01297 return (sciGetGraphicContext(pobj))->marksizeunit;
01298 break;
01299 case SCI_RECTANGLE:
01300 return (sciGetGraphicContext(pobj))->marksizeunit;
01301 break;
01302 case SCI_SURFACE:
01303 return (sciGetGraphicContext(pobj))->marksizeunit;
01304 break;
01305 case SCI_AXES:
01306 return (sciGetGraphicContext(pobj))->marksizeunit;
01307 break;
01308 case SCI_SEGS:
01309 return (sciGetGraphicContext(pobj))->marksizeunit;
01310 break;
01311 case SCI_LEGEND:
01312 return (sciGetGraphicContext(pobj))->marksizeunit;
01313 break;
01314 case SCI_FEC:
01315 case SCI_GRAYPLOT:
01316 case SCI_LIGHT:
01317 case SCI_MENU:
01318 case SCI_MENUCONTEXT:
01319 case SCI_STATUSB:
01320 case SCI_PANNER:
01321 case SCI_SBH:
01322 case SCI_SBV:
01323 case SCI_AGREG:
01324 case SCI_TEXT:
01325 case SCI_TITLE:
01326 case SCI_LABEL:
01327 case SCI_UIMENU:
01328 default:
01329 return -1;
01330 break;
01331 }
01332 return 0;
01333 }
01334
01338 BOOL
01339 sciGetIsLine (sciPointObj * pobj)
01340 {
01341 switch (sciGetEntityType (pobj))
01342 {
01343 case SCI_FIGURE:
01344 return (sciGetGraphicContext(pobj))->isline;
01345 break;
01346 case SCI_SUBWIN:
01347 return (sciGetGraphicContext(pobj))->isline;
01348 break;
01349 case SCI_ARC:
01350 return (sciGetGraphicContext(pobj))->isline;
01351 break;
01352 case SCI_POLYLINE:
01353 return (sciGetGraphicContext(pobj))->isline;
01354 break;
01355 case SCI_RECTANGLE:
01356 return (sciGetGraphicContext(pobj))->isline;
01357 break;
01358 case SCI_SURFACE:
01359 return (sciGetGraphicContext(pobj))->isline;
01360 break;
01361 case SCI_AXES:
01362 return (sciGetGraphicContext(pobj))->isline;
01363 break;
01364 case SCI_FEC:
01365 return (sciGetGraphicContext(pobj))->isline;
01366 break;
01367 case SCI_SEGS:
01368 return (sciGetGraphicContext(pobj))->isline;
01369 break;
01370 case SCI_LEGEND:
01371 return (sciGetGraphicContext(pobj))->isline;
01372 break;
01373 case SCI_TEXT:
01374 return pTEXT_FEATURE(pobj)->isline ;
01375 break ;
01376 case SCI_GRAYPLOT:
01377 case SCI_LIGHT:
01378 case SCI_MENU:
01379 case SCI_MENUCONTEXT:
01380 case SCI_STATUSB:
01381 case SCI_PANNER:
01382 case SCI_SBH:
01383 case SCI_SBV:
01384 case SCI_AGREG:
01385 case SCI_TITLE:
01386 case SCI_LABEL:
01387 case SCI_UIMENU:
01388 default:
01389 sciprint ("This object has no isline\n");
01390 return -1;
01391 break;
01392 }
01393 return 0;
01394 }
01395
01399 BOOL
01400 sciGetIsFilled (sciPointObj * pobj)
01401 {
01402 switch (sciGetEntityType (pobj))
01403 {
01404 case SCI_POLYLINE:
01405 return pPOLYLINE_FEATURE(pobj)->isfilled;
01406 break;
01407 case SCI_RECTANGLE:
01408 return pRECTANGLE_FEATURE(pobj)->fillflag;
01409 break;
01410 case SCI_ARC:
01411 return pARC_FEATURE(pobj)->fill;
01412 break;
01413 case SCI_LABEL:
01414 return sciGetIsFilled( pLABEL_FEATURE(pobj)->text ) ;
01415 break;
01416 case SCI_TEXT:
01417 return pTEXT_FEATURE(pobj)->isfilled ;
01418 break ;
01419 case SCI_FIGURE:
01420 case SCI_SUBWIN:
01421 case SCI_SURFACE:
01422 case SCI_AXES:
01423 case SCI_FEC:
01424 case SCI_SEGS:
01425 case SCI_LEGEND:
01426 case SCI_GRAYPLOT:
01427 case SCI_LIGHT:
01428 case SCI_MENU:
01429 case SCI_MENUCONTEXT:
01430 case SCI_STATUSB:
01431 case SCI_PANNER:
01432 case SCI_SBH:
01433 case SCI_SBV:
01434 case SCI_AGREG:
01435 case SCI_TITLE:
01436 case SCI_UIMENU:
01437 default:
01438 sciprint ("This object has no isfilled\n");
01439 return -1;
01440 break;
01441 }
01442 return 0;
01443 }
01444
01448 int
01449 sciGetFillStyle (sciPointObj * pobj)
01450 {
01451 switch (sciGetEntityType (pobj))
01452 {
01453 case SCI_FIGURE:
01454 return (sciGetGraphicContext(pobj))->fillstyle;
01455 break;
01456 case SCI_SUBWIN:
01457 return sciGetFillStyle (sciGetParent (pobj));
01458 break;
01459 case SCI_TEXT:
01460 return -1;
01461 break;
01462 case SCI_TITLE:
01463 return -1;
01464 break;
01465 case SCI_LEGEND:
01466 return -1;
01467 break;
01468 case SCI_ARC:
01469 return (sciGetGraphicContext(pobj))->fillstyle;
01470 break;
01471 case SCI_POLYLINE:
01472 return (sciGetGraphicContext(pobj))->fillstyle;
01473 break;
01474 case SCI_RECTANGLE:
01475 return (sciGetGraphicContext(pobj))->fillstyle;
01476 break;
01477 case SCI_SURFACE:
01478 return (sciGetGraphicContext(pobj))->fillstyle;
01479 break;
01480 case SCI_AXES:
01481 return (sciGetGraphicContext(pobj))->fillstyle;
01482 break;
01483 case SCI_SEGS:
01484 case SCI_FEC:
01485 case SCI_GRAYPLOT:
01486 case SCI_MENU:
01487 case SCI_MENUCONTEXT:
01488 case SCI_STATUSB:
01489 case SCI_LIGHT:
01490 case SCI_PANNER:
01491 case SCI_SBH:
01492 case SCI_SBV:
01493 case SCI_AGREG:
01494 case SCI_LABEL:
01495 case SCI_UIMENU:
01496 default:
01497 sciprint ("This object has no Fill Style\n");
01498 return -1;
01499 break;
01500 }
01501 return 0;
01502 }
01503
01509 sciFont *
01510 sciGetFontContext (sciPointObj * pobj)
01511 {
01512 switch (sciGetEntityType (pobj))
01513 {
01514 case SCI_TEXT:
01515 return &(pTEXT_FEATURE (pobj)->fontcontext);
01516 break;
01517 case SCI_MENU:
01518 return &(pMENU_FEATURE (pobj)->text.fontcontext);
01519 break;
01520 case SCI_MENUCONTEXT:
01521 return &(pMENUCONTEXT_FEATURE (pobj)->text.fontcontext);
01522 break;
01523 case SCI_STATUSB:
01524 return &(pSTATUSB_FEATURE (pobj)->text.fontcontext);
01525 break;
01526 case SCI_TITLE:
01527 return &(pTITLE_FEATURE (pobj)->text.fontcontext);
01528 break;
01529 case SCI_LEGEND:
01530 return &(pLEGEND_FEATURE (pobj)->text.fontcontext);
01531 break;
01532 case SCI_SUBWIN:
01533 return &(pSUBWIN_FEATURE (pobj)->axes.fontcontext);
01534 break;
01535 case SCI_AXES:
01536
01537 return &(pSUBWIN_FEATURE (sciGetParentSubwin(pobj) )->axes.fontcontext);
01538 break;
01539 case SCI_FIGURE:
01540 return &(pFIGURE_FEATURE (pobj)->fontcontext);
01541 break;
01542 case SCI_LABEL:
01543 return sciGetFontContext( pLABEL_FEATURE(pobj)->text ) ;
01544 break;
01545 case SCI_ARC:
01546 case SCI_SEGS:
01547 case SCI_FEC:
01548 case SCI_GRAYPLOT:
01549 case SCI_POLYLINE:
01550 case SCI_RECTANGLE:
01551 case SCI_SURFACE:
01552 case SCI_LIGHT:
01553 case SCI_AGREG:
01554 case SCI_PANNER:
01555 case SCI_SBH:
01556 case SCI_SBV:
01557 case SCI_UIMENU:
01558 default:
01559 return (sciFont *)NULL;
01560 break;
01561 }
01562 }
01563
01564
01565
01566
01567
01568
01569
01570 int
01571 sciGetFontDeciWidth (sciPointObj * pobj)
01572 {
01573 switch (sciGetEntityType (pobj))
01574 {
01575 case SCI_FIGURE:
01576
01577
01578 return (sciGetFontContext(pobj))->fontdeciwidth;
01579 break;
01580 case SCI_SUBWIN:
01581
01582
01583 return (sciGetFontContext(pobj))->fontdeciwidth;
01584 break;
01585 case SCI_TEXT:
01586 return (sciGetFontContext(pobj))->fontdeciwidth;
01587 break;
01588 case SCI_TITLE:
01589 return (sciGetFontContext(pobj))->fontdeciwidth;
01590 break;
01591 case SCI_LEGEND:
01592 return (sciGetFontContext(pobj))->fontdeciwidth;
01593 break;
01594 case SCI_ARC:
01595 return -1;
01596 break;
01597 case SCI_POLYLINE:
01598 return -1;
01599 break;
01600 case SCI_RECTANGLE:
01601 return -1;
01602 break;
01603 case SCI_SURFACE:
01604 return -1;
01605 break;
01606 case SCI_LIGHT:
01607 return -1;
01608 break;
01609 case SCI_AXES:
01610 return (sciGetFontContext(pobj))->fontdeciwidth;
01611 break;
01612 case SCI_MENU:
01613 return (sciGetFontContext(pobj))->fontdeciwidth;
01614 break;
01615 case SCI_MENUCONTEXT:
01616 return (sciGetFontContext(pobj))->fontdeciwidth;
01617 break;
01618 case SCI_STATUSB:
01619 return (sciGetFontContext(pobj))->fontdeciwidth;
01620 break;
01621 case SCI_LABEL:
01622 return (sciGetFontContext(pobj))->fontdeciwidth;
01623 break;
01624 case SCI_SEGS:
01625 case SCI_FEC:
01626 case SCI_GRAYPLOT:
01627 case SCI_PANNER:
01628 case SCI_SBH:
01629 case SCI_SBV:
01630 case SCI_AGREG:
01631 case SCI_UIMENU:
01632 default:
01633 sciprint ("This object has no fontdeciwidth\n");
01634 return -1;
01635 break;
01636 }
01637 return 0;
01638 }
01639
01640
01641
01642
01643
01644 int
01645 sciGetFontOrientation (sciPointObj * pobj)
01646 {
01647 int tmp;
01648 switch (sciGetEntityType (pobj))
01649 {
01650 case SCI_TEXT:
01651 tmp = (sciGetFontContext(pobj))->textorientation;
01652 return tmp;
01653 break;
01654 case SCI_TITLE:
01655 return (sciGetFontContext(pobj))->textorientation;
01656 break;
01657 case SCI_LEGEND:
01658 return (sciGetFontContext(pobj))->textorientation;
01659 break;
01660 case SCI_AXES:
01661 return (sciGetFontContext(pobj))->textorientation;
01662 break;
01663 case SCI_MENU:
01664 return (sciGetFontContext(pobj))->textorientation;
01665 break;
01666 case SCI_MENUCONTEXT:
01667 return (sciGetFontContext(pobj))->textorientation;
01668 break;
01669 case SCI_STATUSB:
01670 return (sciGetFontContext(pobj))->textorientation;
01671 break;
01672 case SCI_SUBWIN:
01673
01674
01675 return (sciGetFontContext(pobj))->textorientation;
01676 break;
01677 case SCI_FIGURE:
01678
01679 return (sciGetFontContext(pobj))->textorientation;
01680 break;
01681 case SCI_LABEL:
01682
01683 return (sciGetFontContext(pobj))->textorientation;
01684 break;
01685 case SCI_ARC:
01686 case SCI_SEGS:
01687 case SCI_FEC:
01688 case SCI_GRAYPLOT:
01689 case SCI_POLYLINE:
01690 case SCI_RECTANGLE:
01691 case SCI_SURFACE:
01692 case SCI_LIGHT:
01693 case SCI_PANNER:
01694 case SCI_SBH:
01695 case SCI_SBV:
01696 case SCI_AGREG:
01697 case SCI_UIMENU:
01698 default:
01699 sciprint ("This object has no textorientation\n");
01700 return 0;
01701 break;
01702 }
01703 return 0;
01704 }
01705
01706
01707
01708
01716 StringMatrix * sciGetText( sciPointObj * pobj )
01717 {
01718
01719 switch (sciGetEntityType (pobj))
01720 {
01721 case SCI_TEXT:
01722 return pTEXT_FEATURE (pobj)->pStrings;
01723 break;
01724 case SCI_TITLE:
01725 return pTITLE_FEATURE (pobj)->text.pStrings;
01726 break;
01727 case SCI_LEGEND:
01728 return pLEGEND_FEATURE (pobj)->text.pStrings;
01729 break;
01730 case SCI_LABEL:
01731 return sciGetText( pLABEL_FEATURE (pobj)->text ) ;
01732 break;
01733 case SCI_UIMENU:
01734 return pUIMENU_FEATURE (pobj)->label.pStrings;
01735 break;
01736 case SCI_FIGURE:
01737 case SCI_SUBWIN:
01738 case SCI_ARC:
01739 case SCI_SEGS:
01740 case SCI_FEC:
01741 case SCI_GRAYPLOT:
01742 case SCI_POLYLINE:
01743 case SCI_RECTANGLE:
01744 case SCI_SURFACE:
01745 case SCI_LIGHT:
01746 case SCI_AXES:
01747 case SCI_PANNER:
01748 case SCI_SBH:
01749 case SCI_SBV:
01750 case SCI_MENU:
01751 case SCI_MENUCONTEXT:
01752 case SCI_STATUSB:
01753 case SCI_AGREG:
01754 default:
01755 return NULL;
01756 break;
01757 }
01758 }
01759
01766 void sciGetTextSize( sciPointObj * pobj, int * nbRow, int * nbCol )
01767 {
01768 StringMatrix * text = sciGetText( pobj ) ;
01769 if ( text == NULL )
01770 {
01771 *nbRow = -1 ;
01772 *nbCol = -1 ;
01773 }
01774 else
01775 {
01776 *nbRow = getMatNbRow( text ) ;
01777 *nbCol = getMatNbCol( text ) ;
01778 }
01779 }
01780
01781
01787 int
01788 sciGetFontBackground (sciPointObj * pobj)
01789 {
01790
01791 int colorindex = -999;
01792
01793 switch (sciGetEntityType (pobj))
01794 {
01795 case SCI_TEXT:
01796 case SCI_TITLE:
01797 case SCI_LEGEND:
01798 case SCI_MENU:
01799 case SCI_MENUCONTEXT:
01800 case SCI_AXES:
01801 case SCI_STATUSB:
01802 case SCI_SUBWIN:
01803 case SCI_FIGURE:
01804 case SCI_LABEL:
01805 colorindex = (sciGetFontContext(pobj))->backgroundcolor+1;
01806 break;
01807 case SCI_ARC:
01808 case SCI_SEGS:
01809 case SCI_FEC:
01810 case SCI_GRAYPLOT:
01811 case SCI_POLYLINE:
01812 case SCI_RECTANGLE:
01813 case SCI_SURFACE:
01814 case SCI_LIGHT:
01815 case SCI_PANNER:
01816 case SCI_SBH:
01817 case SCI_SBV:
01818 case SCI_AGREG:
01819 case SCI_UIMENU:
01820 default:
01821 return -1;
01822 break;
01823 }
01824
01825 colorindex = sciGetGoodIndex(pobj, colorindex);
01826 return colorindex;
01827 }
01828
01829
01832 int
01833 sciGetFontBackgroundToDisplay (sciPointObj * pobj)
01834 {
01835
01836 int colorindex = -999;
01837 int m = sciGetNumColors(pobj);
01838
01839 switch (sciGetEntityType (pobj))
01840 {
01841 case SCI_TEXT:
01842 case SCI_TITLE:
01843 case SCI_LEGEND:
01844 case SCI_MENU:
01845 case SCI_MENUCONTEXT:
01846 case SCI_AXES:
01847 case SCI_STATUSB:
01848 case SCI_SUBWIN:
01849 case SCI_FIGURE:
01850 case SCI_LABEL:
01851 colorindex = (sciGetFontContext(pobj))->backgroundcolor;
01852 break;
01853 case SCI_ARC:
01854 case SCI_SEGS:
01855 case SCI_FEC:
01856 case SCI_GRAYPLOT:
01857 case SCI_POLYLINE:
01858 case SCI_RECTANGLE:
01859 case SCI_SURFACE:
01860 case SCI_LIGHT:
01861 case SCI_PANNER:
01862 case SCI_SBH:
01863 case SCI_SBV:
01864 case SCI_AGREG:
01865 case SCI_UIMENU:
01866 default:
01867 sciprint ("\r\nNo FontBackground is associated with this Entity");
01868 return -1;
01869 break;
01870 }
01871
01872 colorindex = sciGetGoodIndex(pobj, colorindex);
01873
01874 if((m - colorindex == -1) || (m - colorindex == -2)) colorindex = m - colorindex;
01875
01876 return colorindex;
01877 }
01878
01879
01880
01886 int
01887 sciGetFontForeground (sciPointObj * pobj)
01888 {
01889
01890 int colorindex = -999;
01891
01892 switch (sciGetEntityType (pobj))
01893 {
01894 case SCI_TEXT:
01895 case SCI_TITLE:
01896 case SCI_LEGEND:
01897 case SCI_AXES:
01898 case SCI_MENU:
01899 case SCI_MENUCONTEXT:
01900 case SCI_STATUSB:
01901 case SCI_SUBWIN:
01902 case SCI_FIGURE:
01903 case SCI_LABEL:
01904 colorindex = (sciGetFontContext(pobj))->foregroundcolor + 1 ;
01905 break;
01906 case SCI_ARC:
01907 case SCI_SEGS:
01908 case SCI_FEC:
01909 case SCI_GRAYPLOT:
01910 case SCI_POLYLINE:
01911 case SCI_RECTANGLE:
01912 case SCI_SURFACE:
01913 case SCI_LIGHT:
01914 case SCI_PANNER:
01915 case SCI_SBH:
01916 case SCI_SBV:
01917 case SCI_AGREG:
01918 case SCI_UIMENU:
01919 default:
01920 sciprint ("This object has no text !\n");
01921 return -1;
01922 break;
01923 }
01924
01925 colorindex = sciGetGoodIndex(pobj, colorindex);
01926 return colorindex;
01927 }
01928
01929
01932 int
01933 sciGetFontForegroundToDisplay (sciPointObj * pobj)
01934 {
01935
01936 int colorindex = -999;
01937 int m = sciGetNumColors(pobj);
01938
01939 switch (sciGetEntityType (pobj))
01940 {
01941 case SCI_TEXT:
01942 case SCI_TITLE:
01943 case SCI_LEGEND:
01944 case SCI_AXES:
01945 case SCI_MENU:
01946 case SCI_MENUCONTEXT:
01947 case SCI_STATUSB:
01948 case SCI_SUBWIN:
01949 case SCI_FIGURE:
01950 case SCI_LABEL:
01951 colorindex = (sciGetFontContext(pobj))->foregroundcolor + 1 ;
01952 break;
01953 case SCI_ARC:
01954 case SCI_SEGS:
01955 case SCI_FEC:
01956 case SCI_GRAYPLOT:
01957 case SCI_POLYLINE:
01958 case SCI_RECTANGLE:
01959 case SCI_SURFACE:
01960 case SCI_LIGHT:
01961 case SCI_PANNER:
01962 case SCI_SBH:
01963 case SCI_SBV:
01964 case SCI_AGREG:
01965 case SCI_UIMENU:
01966 default:
01967 sciprint ("\r\nNo FontForeground is associated with this Entity");
01968 return -1;
01969 break;
01970 }
01971
01972 colorindex = sciGetGoodIndex(pobj, colorindex);
01973
01974 if((m - colorindex == -1) || (m - colorindex == -2)) colorindex = m - colorindex;
01975
01976 return colorindex;
01977 }
01978
01979
01986 int
01987 sciGetFontStyle (sciPointObj * pobj)
01988 {
01989
01990
01991 switch (sciGetEntityType (pobj))
01992 {
01993 case SCI_TEXT:
01994 case SCI_TITLE:
01995 case SCI_LEGEND:
01996 case SCI_SUBWIN:
01997 case SCI_FIGURE:
01998 case SCI_LABEL:
01999 return sciGetFontContext(pobj)->fonttype;
02000 break;
02001 case SCI_ARC:
02002 case SCI_SEGS:
02003 case SCI_FEC:
02004 case SCI_GRAYPLOT:
02005 case SCI_POLYLINE:
02006 case SCI_RECTANGLE:
02007 case SCI_SURFACE:
02008 case SCI_LIGHT:
02009 case SCI_AXES:
02010 case SCI_PANNER:
02011 case SCI_SBH:
02012 case SCI_SBV:
02013 case SCI_MENU:
02014 case SCI_MENUCONTEXT:
02015 case SCI_STATUSB:
02016 case SCI_AGREG:
02017 case SCI_UIMENU:
02018 default:
02019 sciprint ("This object has no font style !\n");
02020 return -1;
02021 break;
02022 }
02023 }
02024
02025
02031 char *
02032 sciGetFontName (sciPointObj * pobj)
02033 {
02034
02035 switch (sciGetEntityType (pobj))
02036 {
02037 case SCI_TEXT:
02038 return (sciGetFontContext(pobj))->pfontname;
02039 break;
02040 case SCI_TITLE:
02041 return (sciGetFontContext(pobj))->pfontname;
02042 break;
02043 case SCI_LEGEND:
02044 return (sciGetFontContext(pobj))->pfontname;
02045 break;
02046 case SCI_SUBWIN:
02047 return (sciGetFontContext(pobj))->pfontname;
02048 break;
02049 case SCI_FIGURE:
02050 return (sciGetFontContext(pobj))->pfontname;
02051 break;
02052 case SCI_LABEL:
02053 return (sciGetFontContext(pobj))->pfontname;
02054 break;
02055 case SCI_ARC:
02056 case SCI_SEGS:
02057 case SCI_FEC:
02058 case SCI_GRAYPLOT:
02059 case SCI_POLYLINE:
02060 case SCI_RECTANGLE:
02061 case SCI_SURFACE:
02062 case SCI_LIGHT:
02063 case SCI_AXES:
02064 case SCI_PANNER:
02065 case SCI_SBH:
02066 case SCI_SBV:
02067 case SCI_MENU:
02068 case SCI_MENUCONTEXT:
02069 case SCI_STATUSB:
02070 case SCI_AGREG:
02071 case SCI_UIMENU:
02072 default:
02073 return (char *) NULL;
02074 break;
02075 }
02076 }
02077
02078
02079
02085 unsigned int
02086 sciGetFontNameLength (sciPointObj * pobj)
02087 {
02088
02089 switch (sciGetEntityType (pobj))
02090 {
02091 case SCI_TEXT:
02092 return (sciGetFontContext(pobj))->fontnamelen;
02093 break;
02094 case SCI_TITLE:
02095 return (sciGetFontContext(pobj))->fontnamelen;
02096 break;
02097 case SCI_LEGEND:
02098 return (sciGetFontContext(pobj))->fontnamelen;
02099 break;
02100 case SCI_SUBWIN:
02101 return (sciGetFontContext(pobj))->fontnamelen;
02102 break;
02103 case SCI_FIGURE:
02104 return (sciGetFontContext(pobj))->fontnamelen;
02105 break;
02106 case SCI_LABEL:
02107 return (sciGetFontContext(pobj))->fontnamelen;
02108 break;
02109 case SCI_ARC:
02110 case SCI_SEGS:
02111 case SCI_FEC:
02112 case SCI_GRAYPLOT:
02113 case SCI_POLYLINE:
02114 case SCI_RECTANGLE:
02115 case SCI_SURFACE:
02116 case SCI_LIGHT:
02117 case SCI_AXES:
02118 case SCI_PANNER:
02119 case SCI_SBH:
02120 case SCI_SBV:
02121 case SCI_MENU:
02122 case SCI_MENUCONTEXT:
02123 case SCI_STATUSB:
02124 case SCI_AGREG:
02125 case SCI_UIMENU:
02126 default:
02127 sciprint ("This object has no text !\n");
02128 return 0;
02129 break;
02130 }
02131 }
02132
02133
02134
02140 double
02141 sciGetTextPosX (sciPointObj * pobj)
02142 {
02143
02144 switch (sciGetEntityType (pobj))
02145 {
02146 case SCI_TEXT:
02147 return pTEXT_FEATURE (pobj)->x;
02148 break;
02149 case SCI_TITLE:
02150 case SCI_LEGEND:
02151 case SCI_FIGURE:
02152 case SCI_SUBWIN:
02153 case SCI_ARC:
02154 case SCI_SEGS:
02155 case SCI_FEC:
02156 case SCI_GRAYPLOT:
02157 case SCI_POLYLINE:
02158 case SCI_RECTANGLE:
02159 case SCI_SURFACE:
02160 case SCI_LIGHT:
02161 case SCI_AXES:
02162 case SCI_PANNER:
02163 case SCI_SBH:
02164 case SCI_SBV:
02165 case SCI_MENU:
02166 case SCI_MENUCONTEXT:
02167 case SCI_STATUSB:
02168 case SCI_AGREG:
02169 case SCI_LABEL:
02170 case SCI_UIMENU:
02171 default:
02172 sciprint ("This object has no text !\n");
02173 return 0;
02174 break;
02175 }
02176 return -1;
02177 }
02178
02179
02180
02186 double
02187 sciGetTextPosWidth (sciPointObj * pobj)
02188 {
02189
02190 switch (sciGetEntityType (pobj))
02191 {
02192 case SCI_TEXT:
02193 return 0;
02194 break;
02195 case SCI_TITLE:
02196 case SCI_LEGEND:
02197 case SCI_FIGURE:
02198 case SCI_SUBWIN:
02199 case SCI_ARC:
02200 case SCI_SEGS:
02201 case SCI_FEC:
02202 case SCI_GRAYPLOT:
02203 case SCI_POLYLINE:
02204 case SCI_RECTANGLE:
02205 case SCI_SURFACE:
02206 case SCI_LIGHT:
02207 case SCI_AXES:
02208 case SCI_PANNER:
02209 case SCI_SBH:
02210 case SCI_SBV:
02211 case SCI_MENU:
02212 case SCI_MENUCONTEXT:
02213 case SCI_STATUSB:
02214 case SCI_AGREG:
02215 case SCI_LABEL:
02216 case SCI_UIMENU:
02217 default:
02218 sciprint ("This object has no text !\n");
02219 return 0;
02220 break;
02221 }
02222 return -1;
02223 }
02224
02225
02226
02232 double
02233 sciGetTextPosHeight (sciPointObj * pobj)
02234 {
02235
02236 switch (sciGetEntityType (pobj))
02237 {
02238 case SCI_TEXT:
02239 return 0;
02240 break;
02241 case SCI_TITLE:
02242 case SCI_LEGEND:
02243 case SCI_FIGURE:
02244 case SCI_SUBWIN:
02245 case SCI_ARC:
02246 case SCI_SEGS:
02247 case SCI_FEC:
02248 case SCI_GRAYPLOT:
02249 case SCI_POLYLINE:
02250 case SCI_RECTANGLE:
02251 case SCI_SURFACE:
02252 case SCI_LIGHT:
02253 case SCI_AXES:
02254 case SCI_PANNER:
02255 case SCI_SBH:
02256 case SCI_SBV:
02257 case SCI_MENU:
02258 case SCI_MENUCONTEXT:
02259 case SCI_STATUSB:
02260 case SCI_AGREG:
02261 case SCI_LABEL:
02262 case SCI_UIMENU:
02263 default:
02264 sciprint ("This object has no text !\n");
02265 return 0;
02266 break;
02267 }
02268 return -1;
02269 }
02270
02271
02272
02278 double
02279 sciGetTextPosY (sciPointObj * pobj)
02280 {
02281 switch (sciGetEntityType (pobj))
02282 {
02283 case SCI_TEXT:
02284 return pTEXT_FEATURE (pobj)->y;
02285 break;
02286 case SCI_TITLE:
02287 case SCI_LEGEND:
02288 case SCI_FIGURE:
02289 case SCI_SUBWIN:
02290 case SCI_ARC:
02291 case SCI_SEGS:
02292 case SCI_FEC:
02293 case SCI_GRAYPLOT:
02294 case SCI_POLYLINE:
02295 case SCI_RECTANGLE:
02296 case SCI_SURFACE:
02297 case SCI_LIGHT:
02298 case SCI_AXES:
02299 case SCI_PANNER:
02300 case SCI_SBH:
02301 case SCI_SBV:
02302 case SCI_MENU:
02303 case SCI_MENUCONTEXT:
02304 case SCI_STATUSB:
02305 case SCI_AGREG:
02306 case SCI_LABEL:
02307 case SCI_UIMENU:
02308 default:
02309 sciprint ("This object has no text !\n");
02310 return 0;
02311 break;
02312 }
02313 return -1;
02314 }
02315
02316
02317
02321 POINT2D
02322 sciGetTitlePos (sciPointObj * pobj)
02323 {
02324 POINT2D tmppoint;
02325 if (sciGetEntityType (pobj) == SCI_TITLE)
02326 return pTITLE_FEATURE (pobj)->pos;
02327 else
02328 {
02329 tmppoint.x = -1;
02330 tmppoint.y = -1;
02331 sciprint ("Your are not using a title object !\n");
02332 return tmppoint;
02333 }
02334 }
02335
02336
02337
02343 sciTitlePlace
02344 sciGetTitlePlace (sciPointObj * pobj)
02345 {
02346 if (sciGetEntityType (pobj) == SCI_TITLE)
02347 return pTITLE_FEATURE (pobj)->titleplace;
02348 else
02349 sciprint ("Your are not using a title object !\n");
02350 return (sciTitlePlace)-1;
02351 }
02352
02353
02359 sciLegendPlace
02360 sciGetLegendPlace (sciPointObj * pobj)
02361 {
02362 if ( sciGetEntityType(pobj) == SCI_LEGEND )
02363 {
02364 return pLEGEND_FEATURE (pobj)->place ;
02365 }
02366 else
02367 {
02368 sciprint ("Your are not using a legend object !\n");
02369 return SCI_LEGEND_OUTSIDE ;
02370 }
02371 return SCI_LEGEND_OUTSIDE ;
02372 }
02373
02374
02375
02379 POINT2D
02380 sciGetLegendPos (sciPointObj * pobj)
02381 {
02382 POINT2D tmppoint;
02383 if (sciGetEntityType (pobj) == SCI_LEGEND)
02384 return pLEGEND_FEATURE (pobj)->pos;
02385 else
02386 {
02387 tmppoint.x = -1;
02388 tmppoint.y = -1;
02389 sciprint ("Your are not using a legend object !\n");
02390 return tmppoint;
02391 }
02392 }
02393
02394
02395
02396
02400 sciPointObj *
02401 sciGetParentFigure (sciPointObj * pobj)
02402 {
02403 switch (sciGetEntityType (pobj))
02404 {
02405 case SCI_FIGURE:
02406 return pobj ;
02407 case SCI_TEXT:
02408 case SCI_TITLE:
02409 case SCI_LEGEND:
02410 case SCI_ARC:
02411 case SCI_SEGS:
02412 case SCI_FEC:
02413 case SCI_GRAYPLOT:
02414 case SCI_POLYLINE:
02415 case SCI_RECTANGLE:
02416 case SCI_SURFACE:
02417 case SCI_LIGHT:
02418 case SCI_AXES:
02419 case SCI_SUBWIN:
02420 case SCI_PANNER:
02421 case SCI_SBH:
02422 case SCI_SBV:
02423 case SCI_MENU:
02424 case SCI_MENUCONTEXT:
02425 case SCI_STATUSB:
02426 case SCI_AGREG:
02427 case SCI_MERGE:
02428 case SCI_LABEL:
02429 case SCI_UIMENU:
02430 {
02431 return sciGetParentFigure( sciGetParent( pobj ) ) ;
02432 }
02433 break;
02434 default:
02435 sciprint("Object is not a son of any Figure.\n") ;
02436 return NULL;
02437 break;
02438 }
02439 return NULL;
02440 }
02445 sciPointObj *
02446 sciGetParentSubwin (sciPointObj * pobj)
02447 {
02448 sciPointObj *subwin;
02449
02450 subwin = pobj;
02451 switch (sciGetEntityType (pobj))
02452 {
02453 case SCI_FIGURE:
02454 return sciGetFirstTypedSelectedSon( pobj, SCI_SUBWIN );
02455 break;
02456 case SCI_SUBWIN:
02457 case SCI_TEXT:
02458 case SCI_TITLE:
02459 case SCI_LEGEND:
02460 case SCI_ARC:
02461 case SCI_SEGS:
02462 case SCI_FEC:
02463 case SCI_GRAYPLOT:
02464 case SCI_POLYLINE:
02465 case SCI_RECTANGLE:
02466 case SCI_SURFACE:
02467 case SCI_LIGHT:
02468 case SCI_AXES:
02469 case SCI_PANNER:
02470 case SCI_SBH:
02471 case SCI_SBV:
02472 case SCI_MENU:
02473 case SCI_MENUCONTEXT:
02474 case SCI_STATUSB:
02475 case SCI_AGREG:
02476 case SCI_MERGE:
02477 case SCI_LABEL:
02478 case SCI_UIMENU:
02479 while (sciGetEntityType(subwin) != SCI_SUBWIN)
02480 subwin=sciGetParent(subwin);
02481 return (sciPointObj *) subwin;
02482 break;
02483 default:
02484 sciprint("Object is not a son of any SubWindow.\n") ;
02485 return NULL;
02486 break;
02487 }
02488 return (sciPointObj *) NULL;
02489 }
02490
02494 int
02495 sciGetNumFigure (sciPointObj * pobj)
02496 {
02497 sciPointObj *figure = pobj;
02498
02499 switch (sciGetEntityType (pobj))
02500 {
02501 case SCI_FIGURE:
02502 return sciGetNum(figure) ;
02503 break;
02504 case SCI_SUBWIN:
02505 case SCI_TEXT:
02506 case SCI_TITLE:
02507 case SCI_LEGEND:
02508 case SCI_ARC:
02509 case SCI_SEGS:
02510 case SCI_FEC:
02511 case SCI_GRAYPLOT:
02512 case SCI_POLYLINE:
02513 case SCI_RECTANGLE:
02514 case SCI_SURFACE:
02515 case SCI_LIGHT:
02516 case SCI_AXES:
02517 case SCI_PANNER:
02518 case SCI_SBH:
02519 case SCI_SBV:
02520 case SCI_MENU:
02521 case SCI_MENUCONTEXT:
02522 case SCI_STATUSB:
02523 case SCI_AGREG:
02524 case SCI_LABEL:
02525 case SCI_UIMENU:
02526 while (sciGetEntityType(figure) != SCI_FIGURE)
02527 figure=sciGetParent(figure);
02528 return sciGetNum(figure);
02529 break;
02530 default:
02531 return -1;
02532 break;
02533 }
02534 return -1;
02535 }
02536
02540 struct BCG *
02541 sciGetScilabXgc (sciPointObj * pobj)
02542 {
02543 switch (sciGetEntityType (pobj))
02544 {
02545 case SCI_FIGURE:
02546 return pFIGURE_FEATURE (pobj)->pScilabXgc;
02547 break;
02548 case SCI_TEXT:
02549 case SCI_TITLE:
02550 case SCI_LEGEND:
02551 case SCI_ARC:
02552 case SCI_SEGS:
02553 case SCI_FEC:
02554 case SCI_GRAYPLOT:
02555 case SCI_POLYLINE:
02556 case SCI_RECTANGLE:
02557 case SCI_SURFACE:
02558 case SCI_LIGHT:
02559 case SCI_AXES:
02560 case SCI_SUBWIN:
02561 case SCI_PANNER:
02562 case SCI_SBH:
02563 case SCI_SBV:
02564 case SCI_MENU:
02565 case SCI_MENUCONTEXT:
02566 case SCI_STATUSB:
02567 case SCI_AGREG:
02568 case SCI_MERGE:
02569 case SCI_LABEL:
02570 case SCI_UIMENU:
02571
02572
02573 return (struct BCG *) sciGetScilabXgc (sciGetParent (pobj));
02574 break;
02575 default:
02576 return (struct BCG *) NULL;
02577 break;
02578 }
02579 return (struct BCG *) NULL;
02580 }
02581
02582
02583
02584
02588 scigMode *sciGetGraphicMode (sciPointObj * pobj)
02589 {
02590 switch (sciGetEntityType (pobj))
02591 {
02592 case SCI_FIGURE:
02593 return &(pFIGURE_FEATURE (pobj)->gmode);
02594 break;
02595 case SCI_SUBWIN:
02596 return &(pSUBWIN_FEATURE (pobj)->gmode);
02597 break;
02598 case SCI_ARC:
02599 case SCI_SEGS:
02600 case SCI_FEC:
02601 case SCI_GRAYPLOT:
02602 case SCI_POLYLINE:
02603 case SCI_RECTANGLE:
02604 case SCI_SURFACE:
02605 case SCI_LIGHT:
02606 case SCI_AXES:
02607 case SCI_MENU:
02608 case SCI_MENUCONTEXT:
02609 case SCI_STATUSB:
02610 case SCI_AGREG:
02611 case SCI_TEXT:
02612 case SCI_TITLE:
02613 case SCI_PANNER:
02614 case SCI_SBH:
02615 case SCI_SBV:
02616 case SCI_LEGEND:
02617 case SCI_LABEL:
02618 case SCI_UIMENU:
02619 default:
02620 return (scigMode *) NULL;
02621 break;
02622 }
02623 return (scigMode *) NULL;
02624 }
02625
02626
02628
02629
02630 int
02631 sciGetIsClipRegionValuated (sciPointObj * pobj)
02632 {
02633 switch (sciGetEntityType (pobj))
02634 {
02635 case SCI_SUBWIN:
02636 return pSUBWIN_FEATURE (pobj)->clip_region_set;
02637 break;
02638 case SCI_ARC:
02639 return pARC_FEATURE (pobj)->clip_region_set;
02640 break;
02641 case SCI_POLYLINE:
02642 return pPOLYLINE_FEATURE (pobj)->clip_region_set;
02643 break;
02644 case SCI_RECTANGLE:
02645 return pRECTANGLE_FEATURE (pobj)->clip_region_set;
02646 break;
02647 case SCI_SEGS:
02648 return pSEGS_FEATURE (pobj)->clip_region_set;
02649 break;
02650 case SCI_TEXT:
02651 return pTEXT_FEATURE (pobj)->clip_region_set;
02652 break;
02653 case SCI_LIGHT:
02654 return pLIGHT_FEATURE (pobj)->clip_region_set;
02655 break;
02656 case SCI_AXES:
02657 return pAXES_FEATURE (pobj)->clip_region_set;
02658 break;
02659 case SCI_SURFACE:
02660 case SCI_LEGEND:
02661 case SCI_TITLE:
02662 case SCI_AGREG:
02663 case SCI_FIGURE:
02664 case SCI_FEC:
02665 case SCI_GRAYPLOT:
02666 case SCI_SBH:
02667 case SCI_PANNER:
02668 case SCI_SBV:
02669 case SCI_MENU:
02670 case SCI_MENUCONTEXT:
02671 case SCI_STATUSB:
02672 case SCI_LABEL:
02673 case SCI_UIMENU:
02674 default:
02675 return -2;
02676 break;
02677 }
02678 return -2;
02679 }
02680
02681
02683 int
02684 sciGetIsClipping (sciPointObj * pobj)
02685 {
02686 switch (sciGetEntityType (pobj))
02687 {
02688
02689 case SCI_SUBWIN:
02690 return pSUBWIN_FEATURE (pobj)->isclip;
02691 break;
02692 case SCI_ARC:
02693 return pARC_FEATURE (pobj)->isclip;
02694 break;
02695 case SCI_POLYLINE:
02696 return pPOLYLINE_FEATURE (pobj)->isclip;
02697 break;
02698 case SCI_RECTANGLE:
02699 return pRECTANGLE_FEATURE (pobj)->isclip;
02700 break;
02701 case SCI_SEGS:
02702 return pSEGS_FEATURE (pobj)->isclip;
02703 break;
02704 case SCI_TEXT:
02705 return pTEXT_FEATURE (pobj)->isclip;
02706 break;
02707 case SCI_LIGHT:
02708 return pLIGHT_FEATURE (pobj)->isclip;
02709 break;
02710 case SCI_AXES:
02711 return pAXES_FEATURE (pobj)->isclip;
02712 break;
02713 case SCI_SURFACE:
02714 case SCI_LEGEND:
02715 case SCI_TITLE:
02716 case SCI_AGREG:
02717 case SCI_FIGURE:
02718 case SCI_FEC:
02719 case SCI_GRAYPLOT:
02720 case SCI_SBH:
02721 case SCI_PANNER:
02722 case SCI_SBV:
02723 case SCI_MENU:
02724 case SCI_MENUCONTEXT:
02725 case SCI_STATUSB:
02726 case SCI_LABEL:
02727 case SCI_UIMENU:
02728 default:
02729 return -2;
02730 break;
02731 }
02732 return -2;
02733 }
02734
02735
02740 double *
02741 sciGetClipping (sciPointObj * pobj)
02742 {
02743 switch (sciGetEntityType (pobj))
02744 {
02745
02746 case SCI_SUBWIN:
02747 return pSUBWIN_FEATURE (pobj)->clip_region;
02748 break;
02749 case SCI_ARC:
02750 return pARC_FEATURE (pobj)->clip_region;
02751 break;
02752 case SCI_POLYLINE:
02753 return pPOLYLINE_FEATURE (pobj)->clip_region;
02754 break;
02755 case SCI_RECTANGLE:
02756 return pRECTANGLE_FEATURE (pobj)->clip_region;
02757 break;
02758 case SCI_SEGS:
02759 return pSEGS_FEATURE (pobj)->clip_region;
02760 break;
02761 case SCI_TEXT:
02762 return pTEXT_FEATURE (pobj)->clip_region;
02763 break;
02764 case SCI_LIGHT:
02765 return pLIGHT_FEATURE (pobj)->clip_region;
02766 break;
02767 case SCI_AXES:
02768 return pAXES_FEATURE (pobj)->clip_region;
02769 break;
02770 case SCI_LABEL:
02771 return sciGetClipping( pLABEL_FEATURE(pobj)->text ) ;
02772 break;
02773 case SCI_UIMENU:
02774 case SCI_SURFACE:
02775 case SCI_LEGEND:
02776 case SCI_TITLE:
02777 case SCI_AGREG:
02778 case SCI_FEC:
02779 case SCI_GRAYPLOT:
02780 case SCI_FIGURE:
02781 default:
02782 sciprint("Error: clip_region is NULL\n");
02783 return (double *) NULL;
02784 break;
02785 }
02786 sciprint("Error: clip_region is NULL\n");
02787 return (double *) NULL;
02788
02789 }
02790
02791
02796 BOOL
02797 sciGetHighLight (sciPointObj * pobj)
02798 {
02799 switch (sciGetEntityType (pobj))
02800 {
02801 case SCI_FIGURE:
02802
02803 break;
02804 case SCI_SUBWIN:
02805
02806
02807 break;
02808 case SCI_TEXT:
02809 case SCI_TITLE:
02810 case SCI_LEGEND:
02811 case SCI_ARC:
02812 case SCI_SEGS:
02813 case SCI_FEC:
02814 case SCI_GRAYPLOT:
02815 case SCI_POLYLINE:
02816 case SCI_RECTANGLE:
02817 case SCI_SURFACE:
02818 case SCI_LIGHT:
02819 case SCI_AXES:
02820 case SCI_MENU:
02821 case SCI_MENUCONTEXT:
02822 case SCI_AGREG:
02823 case SCI_LABEL:
02824 case SCI_UIMENU:
02825 default:
02826 sciprint ("This object cannot be highlighted\n");
02827 return FALSE;
02828 break;
02829 }
02830 return FALSE;
02831 }
02832
02833
02841 BOOL
02842 sciGetAddPlot (sciPointObj * pobj)
02843 {
02844 switch (sciGetEntityType (pobj))
02845 {
02846 case SCI_FIGURE:
02847 return (sciGetGraphicMode (pobj))->addplot;
02848 break;
02849 case SCI_SUBWIN:
02850 return (sciGetGraphicMode (pobj))->addplot;
02851 break;
02852 case SCI_TEXT:
02853 case SCI_TITLE:
02854 case SCI_LEGEND:
02855 case SCI_ARC:
02856 case SCI_SEGS:
02857 case SCI_FEC:
02858 case SCI_GRAYPLOT:
02859 case SCI_POLYLINE:
02860 case SCI_RECTANGLE:
02861 case SCI_SURFACE:
02862 case SCI_LIGHT:
02863 case SCI_AXES:
02864 case SCI_MENU:
02865 case SCI_MENUCONTEXT:
02866 case SCI_AGREG:
02867 case SCI_LABEL:
02868 case SCI_UIMENU:
02869 default:
02870 sciprint ("This object cannot be addploted\n");
02871 return FALSE;
02872 break;
02873 }
02874 return FALSE;
02875 }
02876
02877
02881 BOOL
02882 sciGetAutoScale (sciPointObj * pobj)
02883 {
02884 switch (sciGetEntityType (pobj))
02885 {
02886 case SCI_FIGURE:
02887 return (sciGetGraphicMode (pobj))->autoscaling;
02888 break;
02889 case SCI_SUBWIN:
02890 return (sciGetGraphicMode (pobj))->autoscaling;
02891 break;
02892 case SCI_TEXT:
02893 case SCI_TITLE:
02894 case SCI_LEGEND:
02895 case SCI_ARC:
02896 case SCI_SEGS:
02897 case SCI_FEC:
02898 case SCI_GRAYPLOT:
02899 case SCI_POLYLINE:
02900 case SCI_RECTANGLE:
02901 case SCI_SURFACE:
02902 case SCI_LIGHT:
02903 case SCI_AXES:
02904 case SCI_MENU:
02905 case SCI_MENUCONTEXT:
02906 case SCI_AGREG:
02907 case SCI_LABEL:
02908 case SCI_UIMENU:
02909 default:
02910 sciprint ("This object cannot be autoscaled\n");
02911 return FALSE;
02912 break;
02913 }
02914 return FALSE;
02915 }
02916
02917
02921 BOOL
02922 sciGetZooming (sciPointObj * pobj)
02923 {
02924 switch (sciGetEntityType (pobj))
02925 {
02926 case SCI_FIGURE:
02927 return (sciGetGraphicMode (pobj))->zooming;
02928 break;
02929 case SCI_SUBWIN:
02930
02931 return (sciGetGraphicMode (pobj))->zooming;
02932 break;
02933 case SCI_TEXT:
02934 case SCI_TITLE:
02935 case SCI_LEGEND:
02936 case SCI_ARC:
02937 case SCI_SEGS:
02938 case SCI_FEC:
02939 case SCI_GRAYPLOT:
02940 case SCI_POLYLINE:
02941 case SCI_RECTANGLE:
02942 case SCI_SURFACE:
02943 case SCI_LIGHT:
02944 case SCI_AXES:
02945 case SCI_MENU:
02946 case SCI_MENUCONTEXT:
02947 case SCI_AGREG:
02948 case SCI_UIMENU:
02949 case SCI_LABEL:
02950 default:
02951 sciprint ("\r\nThis object cannot be zoomed. \r\n");
02952 return FALSE;
02953 break;
02954 }
02955 return FALSE;
02956 }
02957
02958
02966 int
02967 sciGetXorMode (sciPointObj * pobj)
02968 {
02969 switch (sciGetEntityType (pobj))
02970 {
02971 case SCI_FIGURE:
02972 return (sciGetGraphicMode (pobj))->xormode;
02973 break;
02974 case SCI_SUBWIN:
02975
02976 return sciGetXorMode (sciGetParentFigure (pobj));
02977 break;
02978 case SCI_TEXT:
02979 case SCI_TITLE:
02980 case SCI_LEGEND:
02981 case SCI_ARC:
02982 case SCI_SEGS:
02983 case SCI_FEC:
02984 case SCI_GRAYPLOT:
02985 case SCI_POLYLINE:
02986 case SCI_RECTANGLE:
02987 case SCI_SURFACE:
02988 case SCI_LIGHT:
02989 case SCI_AXES:
02990 case SCI_MENU:
02991 case SCI_MENUCONTEXT:
02992 case SCI_AGREG:
02993 case SCI_LABEL:
02994 case SCI_UIMENU:
02995 default:
02996 sciprint ("\r\nNothing to do\n");
02997 return FALSE;
02998 break;
02999 }
03000 return FALSE;
03001 }
03002
03007 BOOL
03008 sciGetRealVisibility (sciPointObj * pobj)
03009 {
03010
03011 if ( pobj == NULL )
03012 {
03013 return FALSE ;
03014 }
03015
03016 if ( sciGetEntityType( pobj ) == SCI_FIGURE || sciGetEntityType(pobj) == SCI_SCREEN )
03017 {
03018 return sciGetVisibility( pobj ) ;
03019 }
03020
03021 if ( !sciGetVisibility( pobj ) )
03022 {
03023 return FALSE ;
03024 }
03025
03026 return sciGetRealVisibility( sciGetParent( pobj ) ) ;
03027
03028 }
03029
03031 BOOL
03032 sciGetVisibility (sciPointObj * pobj)
03033 {
03034 switch (sciGetEntityType (pobj))
03035 {
03036 case SCI_FIGURE:
03037 return pFIGURE_FEATURE (pobj)->visible;
03038 break;
03039 case SCI_SUBWIN:
03040 return pSUBWIN_FEATURE (pobj)->visible;
03041 break;
03042 case SCI_TITLE:
03043 return pTITLE_FEATURE (pobj)->visible;
03044 break;
03045 case SCI_LEGEND:
03046 return pLEGEND_FEATURE (pobj)->visible;
03047 break;
03048 case SCI_ARC:
03049 return pARC_FEATURE (pobj)->visible;
03050 break;
03051 case SCI_POLYLINE:
03052 return pPOLYLINE_FEATURE (pobj)->visible;
03053 break;
03054 case SCI_RECTANGLE:
03055 return pRECTANGLE_FEATURE (pobj)->visible;
03056 break;
03057 case SCI_SURFACE:
03058 return pSURFACE_FEATURE (pobj)->visible;
03059 break;
03060 case SCI_SEGS:
03061 return pSEGS_FEATURE (pobj)->visible;
03062 break;
03063 case SCI_FEC:
03064 return pFEC_FEATURE (pobj)->visible;
03065 break;
03066 case SCI_GRAYPLOT:
03067 return pGRAYPLOT_FEATURE (pobj)->visible;
03068 break;
03069 case SCI_TEXT:
03070 return pTEXT_FEATURE (pobj)->visible;
03071 break;
03072 case SCI_LIGHT:
03073 return pLIGHT_FEATURE (pobj)->visible;
03074 break;
03075 case SCI_AXES:
03076 return pAXES_FEATURE (pobj)->visible;
03077 break;
03078 case SCI_AGREG:
03079 return pAGREG_FEATURE (pobj)->visible;
03080 break;
03081 case SCI_LABEL:
03082 return sciGetVisibility ( pLABEL_FEATURE (pobj)->text ) ;
03083 break;
03084 case SCI_UIMENU:
03085 return pUIMENU_FEATURE (pobj)->visible;
03086 break;
03087 case SCI_CONSOLE:
03088 return pCONSOLE_FEATURE(pobj)->visible ;
03089 break ;
03090 case SCI_FRAME:
03091 return pFRAME_FEATURE(pobj)->visible ;
03092 break ;
03093 case SCI_WINDOW:
03094 return pWINDOW_FEATURE(pobj)->visible ;
03095 break ;
03096 case SCI_WINDOWFRAME:
03097 return pWINDOWFRAME_FEATURE(pobj)->visible ;
03098 break ;
03099 case SCI_SCREEN:
03100 return pSCREEN_FEATURE(pobj)->visible ;
03101 break ;
03102 case SCI_SBH:
03103 case SCI_PANNER:
03104 case SCI_SBV:
03105 case SCI_MENU:
03106 case SCI_MENUCONTEXT:
03107 case SCI_STATUSB:
03108 default:
03109 return TRUE;
03110 break;
03111 }
03112 }
03113
03114
03115
03121 BOOL
03122 sciGetResize (sciPointObj * pobj)
03123 {
03124 switch (sciGetEntityType (pobj))
03125 {
03126 case SCI_FIGURE:
03127 return (sciGetGraphicMode (pobj))->wresize;
03128 break;
03129 case SCI_SUBWIN:
03130
03131 return sciGetResize (sciGetParent (pobj));
03132 break;
03133 case SCI_TEXT:
03134 case SCI_TITLE:
03135 case SCI_LEGEND:
03136 case SCI_ARC:
03137 case SCI_SEGS:
03138 case SCI_FEC:
03139 case SCI_GRAYPLOT:
03140 case SCI_POLYLINE:
03141 case SCI_RECTANGLE:
03142 case SCI_SURFACE:
03143 case SCI_LIGHT:
03144 case SCI_AXES:
03145 case SCI_MENU:
03146 case SCI_MENUCONTEXT:
03147 case SCI_AGREG:
03148 case SCI_LABEL:
03149 case SCI_UIMENU:
03150 default:
03151 sciprint ("This object cannot be resized\n");
03152 return FALSE;
03153 break;
03154 }
03155 return FALSE;
03156 }
03157
03158
03164 char *
03165 sciGetName (sciPointObj * pobj)
03166 {
03167 switch (sciGetEntityType (pobj))
03168 {
03169 case SCI_FIGURE:
03170 return pFIGURE_FEATURE (pobj)->name;
03171 break;
03172 case SCI_SUBWIN:
03173 case SCI_AGREG:
03174 default:
03175 sciprint ("Only Figure can be named\n");
03176 return NULL;
03177 break;
03178 }
03179 }
03180
03181
03187 int
03188 sciGetNameLength (sciPointObj * pobj)
03189 {
03190 switch (sciGetEntityType (pobj))
03191 {
03192 case SCI_FIGURE:
03193 return pFIGURE_FEATURE (pobj)->namelen;
03194 break;
03195 case SCI_SUBWIN:
03196 return pSUBWIN_FEATURE (pobj)->namelen;
03197 break;
03198 case SCI_AGREG:
03199 default:
03200 sciprint ("Only Figure or SubWindow can be named\n");
03201 return 0;
03202 break;
03203 }
03204 }
03205
03206
03212 int
03213 sciGetNum (sciPointObj * pobj)
03214 {
03215 switch (sciGetEntityType (pobj))
03216 {
03217 case SCI_FIGURE:
03218 return pFIGURE_FEATURE (pobj)->number;
03219 break;
03220 case SCI_SUBWIN:
03221 return sciGetNum (sciGetParent(pobj));
03222 break;
03223 case SCI_AGREG:
03224 default:
03225 sciprint ("Only Figure can be numerated\n");
03226 return -1;
03227 break;
03228 }
03229 }
03230
03231
03238 int sciGetWidth (sciPointObj * pobj)
03239 {
03240 struct BCG *Xgc;
03241 switch (sciGetEntityType (pobj))
03242 {
03243 case SCI_FIGURE:
03244 Xgc=pFIGURE_FEATURE (pobj)->pScilabXgc;
03245 pFIGURE_FEATURE (pobj)->windowdimwidth= Xgc->CWindowWidth;
03246 return pFIGURE_FEATURE (pobj)->windowdimwidth;
03247 break;
03248 case SCI_SUBWIN:
03249 return pSUBWIN_FEATURE (pobj)->windimwidth;
03250 break;
03251 case SCI_CONSOLE:
03252 return -1 ;
03253 break ;
03254 case SCI_FRAME:
03255 return -1 ;
03256 case SCI_WINDOW:
03257 return -1 ;
03258 case SCI_WINDOWFRAME:
03259 return -1 ;
03260 case SCI_SCREEN:
03261 return -1 ;
03262 default:
03263 sciprint ("Object does not have a width.\n");
03264 return -1;
03265 break;
03266 }
03267 }
03268
03269
03275 int sciGetHeight (sciPointObj * pobj)
03276 {
03277 struct BCG *Xgc;
03278 switch (sciGetEntityType (pobj))
03279 {
03280 case SCI_FIGURE:
03281 Xgc=pFIGURE_FEATURE (pobj)->pScilabXgc;
03282 pFIGURE_FEATURE (pobj)->windowdimheight= Xgc->CWindowHeight;
03283 return pFIGURE_FEATURE (pobj)->windowdimheight;
03284 break;
03285 case SCI_SUBWIN:
03286 return pSUBWIN_FEATURE (pobj)->windimheight;
03287 break;
03288 case SCI_CONSOLE:
03289 return -1 ;
03290 case SCI_FRAME:
03291 return -1 ;
03292 case SCI_WINDOW:
03293 return -1 ;
03294 case SCI_WINDOWFRAME:
03295 return -1 ;
03296 case SCI_SCREEN:
03297 return -1 ;
03298 default:
03299 sciprint ("Object does not have a height.\n");
03300 return -1;
03301 break;
03302 }
03303 }
03304
03311 void sciGetDim( sciPointObj * pobj, int * pWidth, int * pHeight )
03312 {
03313 switch (sciGetEntityType (pobj))
03314 {
03315 case SCI_FIGURE:
03316 *pWidth = pFIGURE_FEATURE (pobj)->figuredimwidth ;
03317 *pHeight = pFIGURE_FEATURE (pobj)->figuredimheight ;
03318 break;
03319 case SCI_SUBWIN:
03320 *pWidth = pSUBWIN_FEATURE (pobj)->windimwidth ;
03321 *pHeight = pSUBWIN_FEATURE (pobj)->windimheight ;
03322 break;
03323 default:
03324 sciprint ("Only Figure or Subwin can be sized\n");
03325 break;
03326 }
03327 }
03328
03334 BOOL
03335 sciGetIsFigureIconified (sciPointObj * pobj)
03336 {
03337 switch (sciGetEntityType (pobj))
03338 {
03339 case SCI_FIGURE:
03340
03341
03342
03343 return FALSE;
03344 break;
03345 case SCI_AGREG:
03346 default:
03347 sciprint ("Only Figure can return iconic status\n");
03348 return FALSE;
03349 break;
03350 }
03351 }
03352
03358 int
03359 sciGetSubwindowPosX (sciPointObj * pobj)
03360 {
03361 switch (sciGetEntityType (pobj))
03362 {
03363 case SCI_SUBWIN:
03364
03365 return pSUBWIN_FEATURE (pobj)->infigureposx;
03366
03367 break;
03368 case SCI_AGREG:
03369 default:
03370 sciprint ("Only Figure can return position\n");
03371 return -1;
03372 break;
03373 }
03374 }
03375
03376
03382 int
03383 sciGetSubwindowPosY (sciPointObj * pobj)
03384 {
03385 switch (sciGetEntityType (pobj))
03386 {
03387 case SCI_SUBWIN:
03388
03389 return pSUBWIN_FEATURE (pobj)->infigureposy;
03390
03391 break;
03392 case SCI_AGREG:
03393 default:
03394 sciprint ("Only Figure can return position\n");
03395 return -1;
03396 break;
03397 }
03398 }
03399
03400
03409 sciPointObj *
03410 sciIsExistingSubWin (WRect)
03411 double WRect[4];
03412 {
03413 sciPointObj *pparentfigure;
03414 sciSons *psonstmp;
03415
03416 double WRectTmp[4];
03417 int stop = 0,i;
03418
03419
03420
03421 for(i=0;i<4;i++)
03422 WRectTmp[i] = 0.;
03423
03424 pparentfigure = (sciPointObj *)sciGetCurrentFigure();
03425 if (pparentfigure == NULL)
03426 {
03427 return NULL;
03428 }
03429
03431 if ((WRect[0] == 0.)&&(WRect[1] == 0.)&&(WRect[2] == 1.)&&(WRect[3] == 1.))
03432 return (sciPointObj *) sciGetLastSons (pparentfigure)->pointobj;
03433
03434 psonstmp = sciGetSons (pparentfigure);
03435
03436 if (psonstmp != (sciSons *) NULL)
03437 {
03438
03439
03440
03441
03442
03443 stop = 0;
03444 while ((psonstmp->pnext != (sciSons *) NULL) && (stop == 0))
03445 {
03446 WRectTmp[0] = pSUBWIN_FEATURE (psonstmp->pointobj)->WRect[0];
03447 WRectTmp[1] = pSUBWIN_FEATURE (psonstmp->pointobj)->WRect[1];
03448 WRectTmp[2] = pSUBWIN_FEATURE (psonstmp->pointobj)->WRect[2];
03449 WRectTmp[3] = pSUBWIN_FEATURE (psonstmp->pointobj)->WRect[3];
03450
03451 if ((sciGetEntityType (psonstmp->pointobj) == SCI_SUBWIN)
03452 && (Abs(WRectTmp[0] - WRect[0]) < 1e-8)
03453 && (Abs(WRectTmp[1] - WRect[1]) < 1e-8)
03454 && (Abs(WRectTmp[2] - WRect[2]) < 1e-8)
03455 && (Abs(WRectTmp[3] - WRect[3]) < 1e-8))
03456 {
03457 stop = 1;
03458 }
03459 else
03460 psonstmp = psonstmp->pnext;
03461 }
03462
03463 if ((sciGetEntityType (psonstmp->pointobj) == SCI_SUBWIN)
03464 && (Abs(WRectTmp[0] - WRect[0]) < 1e-8)
03465 && (Abs(WRectTmp[1] - WRect[1]) < 1e-8)
03466 && (Abs(WRectTmp[2] - WRect[2]) < 1e-8)
03467 && (Abs(WRectTmp[3] - WRect[3]) < 1e-8))
03468
03469 return (sciPointObj *) psonstmp->pointobj;
03470 else return (sciPointObj *) NULL;
03471 }
03472
03473 return (sciPointObj *)NULL;
03474 }
03475
03476 sciPointObj * sciIsExistingFigure( int *value )
03477 {
03478 struct BCG *figGC = NULL;
03479 integer v=0;
03480 double dv=0.0;
03481
03482 if(GetDriverId() == 0)
03483 figGC=getWindowXgcNumber(*value);
03484 else
03485 {
03486
03487
03488 C2F(dr)("xget","gc",&v,&v,&v,&v,&v,&v,(double *)&figGC,&dv,&dv,&dv,5L,10L);
03489 }
03490
03491 if ((figGC != (struct BCG *) NULL) && (figGC->mafigure != (sciPointObj *) NULL))
03492 return figGC->mafigure;
03493 else
03494 return (sciPointObj *) NULL;
03495
03496 }
03497
03498
03499
03500
03506 int
03507 sciGetScrollPosV (sciPointObj * pobj)
03508 {
03509 switch (sciGetEntityType (pobj))
03510 {
03511 case SCI_SBV:
03512 default:
03513
03514 return -1;
03515 break;
03516 }
03517 }
03518
03519
03520
03526 int
03527 sciGetScrollPosH (sciPointObj * pobj)
03528 {
03529 switch (sciGetEntityType (pobj))
03530 {
03531 case SCI_SBH:
03532 default:
03533
03534 return -1;
03535 break;
03536 }
03537 }
03538
03539
03540
03546 double *sciGetPoint(sciPointObj * pthis, int *numrow, int *numcol)
03547 {
03548 double *tab;
03549 int i,k;
03550 switch (sciGetEntityType (pthis))
03551 {
03552 case SCI_FIGURE:
03553 {
03554 int posX ;
03555 int posY ;
03556 *numrow = 2;
03557 *numcol = 2;
03558 if ((tab = CALLOC((*numrow)*(*numcol),sizeof(double))) == NULL)
03559 return (double*)NULL;
03560 sciGetScreenPosition( pthis, &posX, &posY ) ;
03561 tab[0] = (double) posX ;
03562 tab[1] = (double) posY ;
03563 tab[2] = (double)sciGetWidth (pthis);
03564 tab[3] = (double)sciGetHeight (pthis);
03565 return tab;
03566 }
03567 case SCI_SUBWIN:
03568 *numrow = 3;
03569 *numcol = 2;
03570 if ((tab = CALLOC((*numrow)*(*numcol),sizeof(double))) == NULL)
03571 return (double*)NULL;
03572 tab[0] = (double) sciGetSubwindowPosX (pthis);
03573 tab[1] = (double) sciGetSubwindowPosY (pthis);
03574 tab[2] = (double)sciGetWidth (pthis);
03575 tab[3] = (double)sciGetHeight (pthis);
03576 tab[4] = (double)sciGetScilabXgc(pthis)->CWindowWidthView;
03577 tab[5] = (double)sciGetScilabXgc(pthis)->CWindowHeightView;
03578 return (double*)tab;
03579 break;
03580 case SCI_POLYLINE:
03581 *numrow = pPOLYLINE_FEATURE (pthis)->n1;
03582 *numcol=(pPOLYLINE_FEATURE (pthis)->pvz != NULL)? 3:2;
03583
03584 if ( (*numrow)*(*numcol) == 0 )
03585 {
03586 return NULL ;
03587 }
03588
03589 if(*numcol==2 && pSUBWIN_FEATURE (sciGetParentSubwin(pthis))->is3d)
03590 {
03591 *numcol = (*numcol)+1;
03592 if ((tab = CALLOC((*numrow)*(*numcol),sizeof(double))) == NULL)
03593 {
03594 sciprint("Cannot return point, memory full.\n") ;
03595 return NULL;
03596 }
03597 for ( i = 0 ; i < *numrow ; i++ )
03598 {
03599 tab[i] = pPOLYLINE_FEATURE (pthis)->pvx[i];
03600 tab[*numrow+i]= pPOLYLINE_FEATURE (pthis)->pvy[i];
03601 tab[(2*(*numrow))+i]= 0.;
03602 }
03603 }
03604 else
03605 {
03606 if ((tab = CALLOC((*numrow)*(*numcol),sizeof(double))) == NULL)
03607 {
03608 sciprint("Cannot return point, memory full.\n") ;
03609 return NULL ;
03610 }
03611 for ( i = 0 ; i < *numrow ; i++ )
03612 {
03613 tab[i] = pPOLYLINE_FEATURE (pthis)->pvx[i];
03614 tab[*numrow+i]= pPOLYLINE_FEATURE (pthis)->pvy[i];
03615 if (*numcol== 3)
03616 {
03617 tab[(2*(*numrow))+i] = pPOLYLINE_FEATURE (pthis)->pvz[i] ;
03618 }
03619 }
03620 }
03621 return tab;
03622 break;
03623 case SCI_RECTANGLE:
03624 *numrow = 1;
03625 *numcol= (pSUBWIN_FEATURE (sciGetParentSubwin(pthis))->is3d) ? 5: 4;
03626 if ((tab = CALLOC((*numrow)*(*numcol),sizeof(double))) == NULL)
03627 return (double*)NULL;
03628 tab[0] = pRECTANGLE_FEATURE (pthis)->x;
03629 tab[1] = pRECTANGLE_FEATURE (pthis)->y;
03630 if (pSUBWIN_FEATURE (sciGetParentSubwin(pthis))->is3d)
03631 {
03632 tab[2] = pRECTANGLE_FEATURE (pthis)->z;
03633 tab[3] = pRECTANGLE_FEATURE (pthis)->width;
03634 tab[4] = pRECTANGLE_FEATURE (pthis)->height;
03635 }
03636 else
03637 {
03638 tab[2] = pRECTANGLE_FEATURE (pthis)->width;
03639 tab[3] = pRECTANGLE_FEATURE (pthis)->height;
03640 }
03641 return (double*)tab;
03642 break;
03643 case SCI_ARC:
03644 *numrow = 1;
03645 *numcol= (pSUBWIN_FEATURE (sciGetParentSubwin(pthis))->is3d) ? 7: 6;
03646 if ((tab = CALLOC((*numrow)*(*numcol),sizeof(double))) == NULL)
03647 return (double*)NULL;
03648 tab[0] = pARC_FEATURE (pthis)->x;
03649 tab[1] = pARC_FEATURE (pthis)->y;
03650 if (pSUBWIN_FEATURE (sciGetParentSubwin(pthis))->is3d)
03651 {
03652 tab[2] = pARC_FEATURE (pthis)->z;
03653 tab[3] = pARC_FEATURE (pthis)->width;
03654 tab[4] = pARC_FEATURE (pthis)->height;
03655 tab[5] = pARC_FEATURE (pthis)->alphabegin;
03656 tab[6] = pARC_FEATURE (pthis)->alphaend;
03657 }
03658 else
03659 {
03660 tab[2] = pARC_FEATURE (pthis)->width;
03661 tab[3] = pARC_FEATURE (pthis)->height;
03662 tab[4] = pARC_FEATURE (pthis)->alphabegin;
03663 tab[5] = pARC_FEATURE (pthis)->alphaend;
03664
03665 }
03666 return (double*)tab;
03667 break;
03668 case SCI_AGREG:
03669
03670
03671
03672
03673
03674
03675
03676
03677
03678 return (double*)NULL;
03679 break;
03680 case SCI_TEXT:
03681 *numrow = 1;
03682 *numcol= (pSUBWIN_FEATURE (sciGetParentSubwin(pthis))->is3d) ? 3: 2;
03683 if ((tab = CALLOC((*numrow)*(*numcol),sizeof(double))) == NULL)
03684 return (double*)NULL;
03685 tab[0] = pTEXT_FEATURE (pthis)->x;
03686 tab[1] = pTEXT_FEATURE (pthis)->y;
03687 if (pSUBWIN_FEATURE (sciGetParentSubwin(pthis))->is3d)
03688 tab[2] = pTEXT_FEATURE (pthis)->z;
03689 return (double*)tab;
03690 break;
03691 case SCI_SBV:
03692 return (double*)NULL;
03693 break;
03694 case SCI_SBH:
03695 return (double*)NULL;
03696
03697 case SCI_SEGS:
03698 if (pSEGS_FEATURE (pthis)->ptype == 0) {
03699 *numrow = pSEGS_FEATURE (pthis)->Nbr1;
03700
03701
03702
03703 if ( pSEGS_FEATURE(pthis)->vz != NULL
03704 || pSUBWIN_FEATURE (sciGetParentSubwin(pthis))->is3d )
03705 {
03706 *numcol = 3 ;
03707 }
03708 else
03709 {
03710 *numcol = 2 ;
03711 }
03713 if ((tab = CALLOC((*numrow)*(*numcol),sizeof(double))) == NULL)
03714 {
03715 return (double*)NULL;
03716 }
03717 for ( i = 0 ; i < *numrow ; i++ )
03718 {
03719 tab[i] = pSEGS_FEATURE (pthis)->vx[i];
03720 tab[*numrow+i]= pSEGS_FEATURE (pthis)->vy[i];
03721 if ( *numcol == 3 )
03722 {
03723 if ( pSEGS_FEATURE (pthis)->vz == NULL )
03724 {
03725
03726 tab[2*(*numrow)+i] = 0.0 ;
03727 }
03728 else
03729 {
03730 tab[2*(*numrow)+i]= pSEGS_FEATURE (pthis)->vz[i];
03731 }
03732 }
03733 }
03734 }
03735 else {
03736 sciprint("Impossible case: champ object is now treated as a tlist. See set/getchampdata\r\n");
03737 return (double *) NULL;
03738 }
03739 return (double*)tab;
03740 break;
03741 case SCI_SURFACE:
03742
03743 sciprint("Impossible case happened ! Check if instruction in matdes.c inside gget function");
03744 return (double*) NULL;
03745 break;
03746 case SCI_GRAYPLOT:
03747 if (pGRAYPLOT_FEATURE (pthis)->type == 0) {
03748 int ny=pGRAYPLOT_FEATURE (pthis)->ny,nx=pGRAYPLOT_FEATURE (pthis)->nx;
03749 *numrow = nx+1;
03750 *numcol = ny+1;
03751 if ((tab = CALLOC(*numrow * *numcol,sizeof(double))) == NULL)
03752 return (double*)NULL;
03753 tab[0]=0;
03754 for (i=0;i < nx;i++)
03755 tab[i+1] = pGRAYPLOT_FEATURE (pthis)->pvecx[i];
03756 for (i=0;i < ny;i++)
03757 tab[*numrow*(i+1)] = pGRAYPLOT_FEATURE (pthis)->pvecy[i];
03758
03759 for (i=0;i < ny;i++)
03760 for (k=0;k < nx;k++)
03761 tab[*numrow*(i+1)+k+1] = pGRAYPLOT_FEATURE (pthis)->pvecz[nx*i+k];
03762 }
03763 else {
03764 int ny=pGRAYPLOT_FEATURE (pthis)->ny-1,nx=pGRAYPLOT_FEATURE (pthis)->nx-1;
03765 *numrow = nx; *numcol = ny;
03766 if ((tab = CALLOC(nx*ny,sizeof(double))) == NULL)
03767 return (double*)NULL;
03768 for (i=0;i < nx*ny;i++)
03769 tab[i] = pGRAYPLOT_FEATURE (pthis)->pvecz[i];
03770 }
03771 return (double*)tab;
03772 break;
03773 case SCI_FEC:
03774 *numcol = 3;
03775 *numrow = pFEC_FEATURE (pthis)->Nnode;
03776 if ((tab = CALLOC(*numrow * 3,sizeof(double))) == NULL)
03777 return (double*)NULL;
03778
03779 for (i=0;i < *numrow;i++) {
03780 tab[i] = pFEC_FEATURE (pthis)->pvecx[i];
03781 tab[*numrow+i] = pFEC_FEATURE (pthis)->pvecy[i];
03782 tab[*numrow*2+i] = pFEC_FEATURE (pthis)->pfun[i];
03783 }
03784 return (double*)tab;
03785 break;
03786 case SCI_TITLE:
03787 case SCI_LEGEND:
03788 case SCI_LIGHT:
03789 case SCI_AXES:
03790 case SCI_PANNER:
03791 case SCI_MENU:
03792 case SCI_MENUCONTEXT:
03793 case SCI_STATUSB:
03794 case SCI_LABEL:
03795 case SCI_UIMENU:
03796 default:
03797 sciprint ("This object has no points Y\n");
03798 return (double*)NULL;
03799 break;
03800 }
03801 return (double*)NULL;
03802 }
03803
03804
03805
03809 sciPointObj
03810 *sciGetObjClicked (sciPointObj *pthis,int x, int y)
03811 {
03812 sciSons *sons;
03813 sciPointObj *result;
03814
03815
03816 if (sciGetEntityType(pthis) != SCI_AGREG)
03817 {
03818 sons = sciGetSons (pthis);
03819 while ((sons != (sciSons *) NULL) && (sons->pointobj != (sciPointObj *) NULL))
03820 {
03821 result = sciGetObjClicked (sons->pointobj, x, y);
03822
03823 if (result == (sciPointObj *)NULL)
03824 sons = sons->pnext;
03825 else return result;
03826 }
03827 }
03828 if (sciIsClicked(pthis, x, y))
03829 return (sciPointObj *)pthis;
03830 else return (sciPointObj *)NULL;
03831 return (sciPointObj *)NULL;
03832 }
03833
03834
03835
03839
03840 BOOL
03841 sciIsClicked(sciPointObj *pthis,int x, int y)
03842 {
03843 double xtmp, ytmp, xtmp2, ytmp2;
03844 double DELTAX, DELTAY, vect[4];
03845 int n, xm[4];
03846 double *tab;
03847 int numrow, numcol, i;
03848
03849 switch (sciGetEntityType (pthis))
03850 {
03851 case SCI_SUBWIN:
03852 xtmp = (sciGetWidth (pthis)*(pSUBWIN_FEATURE (pthis)->WRect[0]));
03853 xtmp2 = xtmp + (sciGetWidth (pthis)*(pSUBWIN_FEATURE (pthis)->WRect[2]));
03854 ytmp = (sciGetHeight(pthis)*(pSUBWIN_FEATURE (pthis)->WRect[1]));
03855 ytmp2 = ytmp + (sciGetHeight(pthis)*(pSUBWIN_FEATURE (pthis)->WRect[3]));
03856 if (
03857 (x >= xtmp)
03858 && (y >= ytmp)
03859 && (x <= xtmp2)
03860 && (y <= ytmp2)
03861 )
03862 {
03863
03864
03865 set_scale ("tttftf", pSUBWIN_FEATURE (pthis)->WRect,
03866 pSUBWIN_FEATURE (pthis)->FRect, NULL, "nn", NULL);
03867 return TRUE;
03868 }
03869 else
03870 return FALSE;
03871 break;
03872 case SCI_ARC:
03873
03874
03875
03876 set_scale ("tttftf", pSUBWIN_FEATURE (sciGetParent(pthis))->WRect,
03877 pSUBWIN_FEATURE (sciGetParent(pthis))->FRect, NULL, "nn", NULL);
03878 DELTAX = fabs(0.01 * sciGetWidth (sciGetParent(pthis)));
03879 DELTAY = fabs(0.01 * sciGetHeight (sciGetParent(pthis)));
03880 n = 4;
03881 vect[0] = pARC_FEATURE (pthis)->x;
03882 vect[1] = pARC_FEATURE (pthis)->y;
03883 vect[2] = pARC_FEATURE (pthis)->width;
03884 vect[3] = pARC_FEATURE (pthis)->height;
03885 C2F(rect2d)(vect, xm, &n,"f2i");
03886 if (
03887 ((abs(x - xm[0]) < DELTAX) && ((y - xm[1]) < DELTAY)) ||
03888 ((abs(x - xm[0] - xm[2]) < DELTAX) && (abs(y - xm[1]) < DELTAY)) ||
03889 ((abs(x - xm[0]) < DELTAX) && (abs(y - xm[1] - xm[3]) < DELTAY)) ||
03890 ((abs(x - xm[0] - xm[2]) < DELTAX) && (abs(y - xm[1] - xm[3]) < DELTAY))
03891 )
03892 {
03893 return TRUE;
03894 }
03895 return FALSE;
03896 break;
03897 case SCI_RECTANGLE:
03898
03899 set_scale ("tttftf", pSUBWIN_FEATURE (sciGetParent(pthis))->WRect,
03900 pSUBWIN_FEATURE (sciGetParent(pthis))->FRect, NULL, "nn", NULL);
03901 DELTAX = fabs(0.01 * sciGetWidth (sciGetParent(pthis)));
03902 DELTAY = fabs(0.01 * sciGetHeight (sciGetParent(pthis)));
03903 n=4;
03904 vect[0] = pRECTANGLE_FEATURE (pthis)->x;
03905 vect[1] = pRECTANGLE_FEATURE (pthis)->y;
03906 vect[2] = pRECTANGLE_FEATURE (pthis)->width;
03907 vect[3] = pRECTANGLE_FEATURE (pthis)->height;
03908 C2F(rect2d)(vect, xm, &n,"f2i");
03909 if (
03910 ((abs(x - xm[0]) < DELTAX) && ((y - xm[1]) < DELTAY)) ||
03911 ((abs(x - xm[0] - xm[2]) < DELTAX) && (abs(y - xm[1]) < DELTAY)) ||
03912 ((abs(x - xm[0]) < DELTAX) && (abs(y - xm[1] - xm[3]) < DELTAY)) ||
03913 ((abs(x - xm[0] - xm[2]) < DELTAX) && (abs(y - xm[1] - xm[3]) < DELTAY))
03914 )
03915 {
03916 return TRUE;
03917 }
03918 return FALSE;
03919 break;
03920 case SCI_POLYLINE:
03921 set_scale ("tttftf", pSUBWIN_FEATURE (sciGetParent(pthis))->WRect,
03922 pSUBWIN_FEATURE (sciGetParent(pthis))->FRect, NULL, "nn", NULL);
03923 DELTAX = fabs(0.01 * sciGetWidth (sciGetParent(pthis)));
03924 DELTAY = fabs(0.01 * sciGetHeight (sciGetParent(pthis)));
03925 tab = sciGetPoint(pthis, &numrow, &numcol);
03926 i = 0;
03927 while((i < numrow) &&
03928 ((abs(XDouble2Pixel(tab[2*i]) - x) > DELTAX) ||
03929 (abs(YDouble2Pixel(tab[2*i+1]) - y) > DELTAY)))
03930 {
03931 i++;
03932 }
03933 if ((i < numrow) && (abs(XDouble2Pixel(tab[2*i]) - x) < DELTAX) &&
03934 (abs(YDouble2Pixel(tab[2*i+1]) - y) < DELTAY))
03935 {
03936 FREE(tab);
03937 return TRUE;
03938 }
03939 FREE(tab);
03940 return FALSE;
03941 break;
03942 case SCI_AGREG:
03943 case SCI_SEGS:
03944 case SCI_FEC:
03945 case SCI_GRAYPLOT:
03946 case SCI_TEXT:
03947 case SCI_TITLE:
03948 case SCI_LEGEND:
03949 case SCI_SURFACE:
03950 case SCI_AXES:
03951 case SCI_PANNER:
03952 case SCI_MENU:
03953 case SCI_MENUCONTEXT:
03954 case SCI_STATUSB:
03955 case SCI_FIGURE:
03956 case SCI_SBV:
03957 case SCI_SBH:
03958 case SCI_LIGHT:
03959 case SCI_LABEL:
03960 case SCI_UIMENU:
03961 default:
03962 return FALSE;
03963 break;
03964 }
03965 return FALSE;
03966 }
03967
03968
03969 BOOL
03970 sciGetdrawmode (sciPointObj *pobj)
03971 {
03972 static sciPointObj *subwin;
03973
03974 subwin= (sciPointObj *) sciGetParentSubwin (pobj);
03975 if (subwin != (sciPointObj *) NULL)
03976 return pSUBWIN_FEATURE(subwin)->visible ;
03977 return FALSE;
03978 }
03979
03984 sciPointObj *
03985 sciGetAxes (pparentfigure,psubwin)
03986 sciPointObj *pparentfigure;
03987 sciPointObj *psubwin;
03988 {
03989 sciSons *psonstmp;
03990
03991 psonstmp = sciGetSons (pparentfigure);
03992
03993
03994 if (psonstmp != (sciSons *) NULL)
03995 {
03996
03997 while ((psonstmp->pnext != (sciSons *) NULL)
03998 && (sciGetEntityType (psonstmp->pointobj) != SCI_SUBWIN))
03999 psonstmp = psonstmp->pnext;
04000
04001 if (psonstmp->pnext == (sciSons *) NULL)
04002 return (sciPointObj *) NULL;
04003 else
04004 if (sciGetEntityType (psonstmp->pointobj) == SCI_SUBWIN)
04005 return (sciPointObj *)psonstmp->pointobj;
04006 else
04007 return (sciPointObj *) NULL;
04008 }
04009 else
04010 return (sciPointObj *) NULL;
04011 }
04012
04017 void sciGetPointerToUserData (sciPointObj * pobj,int ***user_data_ptr, int **size_ptr)
04018 {
04019
04020
04021 switch (sciGetEntityType (pobj))
04022 {
04023 case SCI_FIGURE:
04024 *user_data_ptr = &(((sciFigure *) pFIGURE_FEATURE (pobj))->user_data);
04025 *size_ptr=&(((sciFigure *) pFIGURE_FEATURE (pobj))->size_of_user_data);
04026 break;
04027 case SCI_SUBWIN:
04028 *user_data_ptr = &(((sciSubWindow *) pSUBWIN_FEATURE (pobj))->user_data);
04029 *size_ptr = &(((sciSubWindow *) pSUBWIN_FEATURE (pobj))->size_of_user_data);
04030 break;
04031 case SCI_TEXT:
04032 *user_data_ptr = &(((sciText *) pTEXT_FEATURE (pobj))->user_data);
04033 *size_ptr = &(((sciText *) pTEXT_FEATURE (pobj))->size_of_user_data);
04034 break;
04035 case SCI_TITLE:
04036 *user_data_ptr = (int **)NULL;
04037 *size_ptr = (int *)NULL;
04038 break;
04039 case SCI_LEGEND:
04040 *user_data_ptr = &(((sciLegend *) pLEGEND_FEATURE (pobj))->user_data);
04041 *size_ptr = &(((sciLegend *) pLEGEND_FEATURE (pobj))->size_of_user_data);
04042 break;
04043 case SCI_ARC:
04044 *user_data_ptr = &(((sciArc *) pARC_FEATURE (pobj))->user_data);
04045 *size_ptr = &(((sciArc *) pARC_FEATURE (pobj))->size_of_user_data);
04046 break;
04047 case SCI_POLYLINE:
04048 *user_data_ptr = &(((sciPolyline *) pPOLYLINE_FEATURE (pobj))->user_data);
04049 *size_ptr = &(((sciPolyline *) pPOLYLINE_FEATURE (pobj))->size_of_user_data);
04050 break;
04051 case SCI_SEGS:
04052 *user_data_ptr = &(((sciSegs *) pSEGS_FEATURE (pobj))->user_data);
04053 *size_ptr = &(((sciSegs *) pSEGS_FEATURE (pobj))->size_of_user_data );
04054 break;
04055 case SCI_FEC:
04056 *user_data_ptr = &(((sciFec *) pFEC_FEATURE (pobj))->user_data);
04057 *size_ptr = &(((sciFec *) pFEC_FEATURE (pobj))->size_of_user_data) ;
04058 break;
04059 case SCI_GRAYPLOT:
04060 *user_data_ptr = &(((sciGrayplot *) pGRAYPLOT_FEATURE (pobj))->user_data);
04061 *size_ptr = &(((sciGrayplot *) pGRAYPLOT_FEATURE (pobj))->size_of_user_data);
04062 break;
04063 case SCI_RECTANGLE:
04064 *user_data_ptr = &(((sciRectangle *) pRECTANGLE_FEATURE (pobj))->user_data);
04065 *size_ptr = &(((sciRectangle *) pRECTANGLE_FEATURE (pobj))->size_of_user_data);
04066 break;
04067 case SCI_SURFACE:
04068 *user_data_ptr = &(((sciSurface *) pSURFACE_FEATURE (pobj))->user_data);
04069 *size_ptr = &(((sciSurface *) pSURFACE_FEATURE (pobj))->size_of_user_data);
04070 break;
04071 case SCI_LIGHT:
04072 *user_data_ptr = &(((sciLightSource *) pLIGHT_FEATURE (pobj))->user_data);
04073 *size_ptr = &(((sciLightSource *) pLIGHT_FEATURE (pobj))->size_of_user_data);
04074 break;
04075 case SCI_AXES:
04076 *user_data_ptr = &(((sciAxes *) pAXES_FEATURE (pobj))->user_data);
04077 *size_ptr = &(((sciAxes *) pAXES_FEATURE (pobj))->size_of_user_data);
04078 break;
04079 case SCI_PANNER:
04080 *user_data_ptr = (int **)NULL;
04081 *size_ptr = (int *)NULL;
04082 break;
04083 case SCI_SBH:
04084 *user_data_ptr = (int **)NULL;
04085 *size_ptr = (int *)NULL;
04086 break;
04087 case SCI_SBV:
04088 *user_data_ptr = (int **)NULL;
04089 *size_ptr = (int *)NULL;
04090 break;
04091 case SCI_MENU:
04092 *user_data_ptr = (int **)NULL;
04093 *size_ptr = (int *)NULL;
04094 break;
04095 case SCI_MENUCONTEXT:
04096 *user_data_ptr = (int **)NULL;
04097 *size_ptr = (int *)NULL;
04098 break;
04099 case SCI_STATUSB:
04100 *user_data_ptr = (int **)NULL;
04101 *size_ptr = (int *)NULL;
04102 break;
04103 case SCI_AGREG:
04104 *user_data_ptr = &(((sciAgreg *) pAGREG_FEATURE (pobj))->user_data);
04105 *size_ptr = &(((sciAgreg *) pAGREG_FEATURE (pobj))->size_of_user_data);
04106 break;
04107 case SCI_MERGE:
04108 *user_data_ptr = &(((sciMerge *) pMERGE_FEATURE (pobj))->user_data);
04109 *size_ptr = &(((sciMerge *) pMERGE_FEATURE (pobj))->size_of_user_data);
04110 break;
04111 case SCI_LABEL:
04112 sciGetPointerToUserData ( pLABEL_FEATURE(pobj)->text, user_data_ptr, size_ptr ) ;
04113 break;
04114 case SCI_CONSOLE:
04115 *user_data_ptr = &(pCONSOLE_FEATURE (pobj)->user_data);
04116 *size_ptr=&(pCONSOLE_FEATURE (pobj)->size_of_user_data);
04117 case SCI_FRAME:
04118 *user_data_ptr = &(pFRAME_FEATURE (pobj)->user_data);
04119 *size_ptr=&(pFRAME_FEATURE (pobj)->size_of_user_data);
04120 case SCI_WINDOW:
04121 *user_data_ptr = &(pWINDOW_FEATURE (pobj)->user_data);
04122 *size_ptr=&(pWINDOW_FEATURE (pobj)->size_of_user_data);
04123 case SCI_WINDOWFRAME:
04124 *user_data_ptr = &(pWINDOWFRAME_FEATURE (pobj)->user_data);
04125 *size_ptr=&(pWINDOWFRAME_FEATURE (pobj)->size_of_user_data);
04126 case SCI_SCREEN:
04127 *user_data_ptr = &(pSCREEN_FEATURE (pobj)->user_data);
04128 *size_ptr=&(pSCREEN_FEATURE (pobj)->size_of_user_data);
04129 break;
04130
04131 case SCI_UIMENU:
04132 default:
04133 *user_data_ptr = (int **)NULL;
04134 *size_ptr = (int *)NULL;
04135 break;
04136 }
04137 }
04138
04139
04144 int sciType (marker, pobj)
04145 char *marker;
04146 sciPointObj * pobj;
04147 {
04148 if (strcmp(marker,"arrow_size_factor") == 0) { return 1;}
04149 else if (strcmp(marker,"x_shift") == 0) { return 1;}
04150 else if (strcmp(marker,"y_shift") == 0) { return 1;}
04151 else if (strcmp(marker,"z_shift") == 0) { return 1;}
04152 else if (strcmp(marker,"bar_width") == 0) { return 1;}
04153 else if (strcmp(marker,"closed") == 0) { return 10;}
04154 else if (strcmp(marker,"label") == 0) { return 10;}
04155 else if (strcmp(marker,"callback") == 0) { return 10;}
04156 else if (strcmp(marker,"background") == 0) { return 1;}
04157 else if (strcmp(marker,"position") == 0) {return 1;}
04158 else if (strcmp(marker,"auto_position") == 0) {return 10;}
04159 else if (strcmp(marker,"auto_rotation") == 0) {return 10;}
04160 else if (strcmp(marker,"interp_color_vector") == 0) {return 1;}
04161 else if (strcmp(marker,"interp_color_mode") == 0) {return 10;}
04162 else if (strcmp(marker,"foreground") == 0) {return 1;}
04163 else if (strcmp(marker,"thickness") == 0) {return 1;}
04164 else if (strcmp(marker,"line_style") == 0) {return 1;}
04165 else if (strcmp(marker,"line_mode") == 0) {return 10;}
04166 else if (strcmp(marker,"fill_mode") == 0) {return 10;}
04167 else if (strcmp(marker,"surface_mode") == 0) {return 10;}
04168 else if (strcmp(marker,"mark_style") == 0) {return 1;}
04169 else if (strcmp(marker,"mark_size") == 0) {return 1;}
04170 else if (strcmp(marker,"mark_size_unit") == 0) {return 10;}
04171 else if (strcmp(marker,"mark_mode") == 0) {return 10;}
04172 else if (strcmp(marker,"mark_foreground") == 0) {return 1;}
04173 else if (strcmp(marker,"mark_background") == 0) {return 1;}
04174 else if (strcmp(marker,"figure_position") == 0) {return 1;}
04175 else if (strcmp(marker,"axes_size") == 0) {return 1;}
04176 else if (strcmp(marker,"axes_visible") == 0) {return 10;}
04177 else if (strcmp(marker,"hiddencolor") == 0) {return 1;}
04178 else if (strcmp(marker,"isoview") == 0) {return 10;}
04179 else if (strcmp(marker,"view") == 0) {return 10;}
04180 else if (strcmp(marker,"figure_size") == 0){return 1;}
04181 else if (strcmp(marker,"figure_id") == 0) {return 1;}
04182 else if (strcmp(marker,"figure_name") == 0){return 10;}
04183 else if (strcmp(marker,"figures_id") == 0) {return 1;}
04184 else if (strcmp(marker,"pixmap") == 0) {return 10;}
04185 else if (strcmp(marker,"polyline_style") == 0){return 1;}
04186 else if (strcmp(marker,"font_size") == 0) {return 1;}
04187 else if (strcmp(marker,"font_angle") == 0) {return 1;}
04188 else if (strcmp(marker,"font_foreground") == 0){return 1;}
04189 else if (strcmp(marker,"font_color") == 0) {return 1;}
04190 else if (strcmp(marker,"font_style") == 0) {return 1;}
04191 else if (strcmp(marker,"font_name") == 0) {return 10;}
04192 else if (strcmp(marker,"textcolor" ) == 0) {return 1;}
04193 else if (strcmp(marker,"labels_font_size" ) == 0) {return 1;}
04194 else if (strcmp(marker,"labels_font_color" ) == 0) {return 1;}
04195 else if (strcmp(marker,"text" ) == 0) {return 10;}
04196 else if (strcmp(marker,"text_box" ) == 0) {return 1;}
04197 else if (strcmp(marker,"text_box_mode" ) == 0) {return 10;}
04198 else if (strcmp(marker,"old_style" ) == 0) {return 10;}
04199 else if (strcmp(marker,"figure_style" ) == 0) {return 10;}
04200 else if (strcmp(marker,"visible" ) == 0) {return 10;}
04201 else if (strcmp(marker,"auto_resize" ) == 0) {return 10;}
04202 else if (strcmp(marker,"pixel_drawing_mode" ) == 0) {return 10;}
04203 else if (strcmp(marker,"default_values" ) == 0) {return 1 ;}
04204 else if (strcmp(marker,"color_map" ) == 0) {return 1 ;}
04205 else if (strcmp(marker,"x_location" ) == 0) {return 10;}
04206 else if (strcmp(marker,"y_location" ) == 0) {return 10;}
04207 else if (strcmp(marker,"tics_direction" ) == 0) {return 10;}
04208 else if (strcmp(marker,"tight_limits" ) == 0) {return 10;}
04209 else if (strcmp(marker,"box" ) == 0) {return 10;}
04210 else if (strcmp(marker,"tics_color" ) == 0) {return 1 ;}
04211 else if (strcmp(marker,"tics_textcolor" ) == 0) {return 1 ;}
04212 else if (strcmp(marker,"tics_textsize" ) == 0) {return 1 ;}
04213 else if (strcmp(marker,"xtics_coord" ) == 0) {return 1 ;}
04214 else if (strcmp(marker,"ytics_coord" ) == 0) {return 1 ;}
04215 else if (strcmp(marker,"grid" ) == 0) {return 1 ;}
04216 else if (strcmp(marker,"tics_segment" ) == 0) {return 10;}
04217 else if (strcmp(marker,"tics_style" ) == 0) {return 10;}
04218 else if (strcmp(marker,"format_n" ) == 0) {return 10;}
04219 else if (strcmp(marker,"tics_labels" ) == 0) {return 10;}
04220 else if (strcmp(marker,"sub_tics" ) == 0) {return 1 ;}
04221 else if (strcmp(marker,"sub_ticks" ) == 0) {return 1 ;}
04222 else if (strcmp(marker,"zoom_box" ) == 0) {return 1 ;}
04223 else if (strcmp(marker,"zoom_state" ) == 0) {return 10;}
04224 else if (strcmp(marker,"clip_box" ) == 0) {return 1 ;}
04225 else if (strcmp(marker,"clip_state" ) == 0) {return 10;}
04226 else if (strcmp(marker,"auto_clear" ) == 0) {return 10;}
04227 else if (strcmp(marker,"auto_scale" ) == 0) {return 10;}
04228 else if (strcmp(marker,"arrow_size" ) == 0) {return 1 ;}
04229 else if (strcmp(marker,"segs_color" ) == 0) {return 1 ;}
04230 else if (strcmp(marker,"colored" ) == 0) {return 10;}
04231 else if (strcmp(marker,"data" ) == 0)
04232 if((sciGetEntityType(pobj) == SCI_SURFACE) ||
04233 (sciGetEntityType(pobj) == SCI_SEGS && pSEGS_FEATURE(pobj)->ptype == 1) ||
04234 (sciGetEntityType(pobj) == SCI_GRAYPLOT && pGRAYPLOT_FEATURE(pobj)->type == 0))
04235 return 16;
04236 else
04237 return 1;
04238 else if (strcmp(marker,"hdl" ) == 0) {return 1 ;}
04239 else if (strcmp(marker,"callbackmevent" ) == 0) {return 1 ;}
04240 else if (strcmp(marker,"callback" ) == 0) {return 10;}
04241 else if (strcmp(marker,"log_flags" ) == 0) {return 10;}
04242 else if (strcmp(marker,"data_mapping" ) == 0) {return 10;}
04243 else if (strcmp(marker,"surface_color" ) == 0) {return 1 ;}
04244 else if (strcmp(marker,"rotation_angles" ) == 0) {return 1 ;}
04245 else if (strcmp(marker,"color_mode" ) == 0) {return 1 ;}
04246 else if (strcmp(marker,"color_flag" ) == 0) {return 1 ;}
04247 else if (strcmp(marker,"cdata_mapping" ) == 0) {return 10;}
04248 else if (strcmp(marker,"axes_bounds" ) == 0) {return 1 ;}
04249 else if (strcmp(marker,"data_bounds" ) == 0) {return 1 ;}
04250 else if (strcmp(marker,"margins" ) == 0) {return 1 ;}
04251 else if (strcmp(marker,"surface_color" ) == 0) {return 1 ;}
04252 else if (strcmp(marker,"rotation_style" ) == 0) {return 10;}
04253 else if (strcmp(marker,"triangles" ) == 0) {return 1 ;}
04254 else if (strcmp(marker,"z_bounds" ) == 0) {return 1 ;}
04255 else if (strcmp(marker,"current_axes" ) == 0) {return 9 ;}
04256 else if (strcmp(marker,"current_figure" ) == 0) {return 9 ;}
04257 else if (strcmp(marker,"current_obj" ) == 0) {return 9 ;}
04258 else if (strcmp(marker,"current_entity" ) == 0) {return 9 ;}
04259 else if (strcmp(marker,"default_axes" ) == 0) {return 9 ;}
04260 else if (strcmp(marker,"default_figure" ) == 0) {return 9 ;}
04261 else if (strcmp(marker,"children" ) == 0) {return 9 ;}
04262 else if (strcmp(marker,"cube_scaling" ) == 0) {return 10;}
04263 else if (strcmp(marker,"x_label" ) == 0) {return 9 ;}
04264 else if (strcmp(marker,"y_label" ) == 0) {return 9 ;}
04265 else if (strcmp(marker,"z_label" ) == 0) {return 9 ;}
04266 else if (strcmp(marker,"title" ) == 0) {return 9 ;}
04267 else if (strcmp(marker,"x_ticks" ) == 0) {return 16;}
04268 else if (strcmp(marker,"y_ticks" ) == 0) {return 16;}
04269 else if (strcmp(marker,"z_ticks" ) == 0) {return 16;}
04270 else if (strcmp(marker,"auto_ticks" ) == 0) {return 10;}
04271 else if (strcmp(marker,"axes_reverse" ) == 0) {return 10;}
04272 else if (strcmp(marker,"immediate_drawing" ) == 0) {return 10;}
04273 else if (strcmp(marker,"handle_visible" ) == 0) {return 10;}
04274 else if (strcmp(marker,"menu_enable" ) == 0) {return 10;}
04275 else if (strcmp(marker,"callback_type" ) == 0) {return 10;}
04276 else if (strcmp(marker,"bounding_rect" ) == 0) {return 1 ;}
04277 else if (strcmp(marker,"hidden_axis_color" ) == 0) {return 1 ;}
04278 else if (strcmp(marker,"alignment" ) == 0) {return 10;}
04279 else if (strcmp(marker,"viewport" ) == 0) {return 1 ;}
04280 else if (strcmp(marker,"info_message" ) == 0) {return 10;}
04281 else {return -1;}
04282 }
04283
04287 int sciGetNbFigure( void )
04288 {
04289 int nbFig = 0 ;
04290 int flag = 0 ;
04291 sciGetIdFigure( NULL, &nbFig, &flag ) ;
04292 return nbFig ;
04293 }
04294
04301 void sciGetFiguresId( int figIds[] )
04302 {
04303 int flag = 1 ;
04304 sciGetIdFigure( figIds, NULL, &flag ) ;
04305 }
04306
04310 void
04311 sciGetIdFigure ( int * vect, int * id, int * flag )
04312 {
04313 sciHandleTab *hdl;
04314 sciPointObj *pobj;
04315 int nbFig = 0 ;
04316
04317 hdl = PENDOFHANDLETAB;
04318 while (hdl != NULL)
04319 {
04320 sciFigure * ppfigure = NULL;
04321 pobj=(sciPointObj *) sciGetPointerFromHandle (hdl->index);
04322 ppfigure = pFIGURE_FEATURE(pobj);
04323 if (sciGetEntityType(pobj) == SCI_FIGURE)
04324 {
04325 if ( *flag != 0 )
04326 {
04327 vect[nbFig] = sciGetNum(pobj);
04328 }
04329 nbFig++ ;
04330 }
04331 hdl = hdl->pprev;
04332 }
04333 if ( id != NULL )
04334 {
04335 *id = nbFig ;
04336 }
04337
04338 }
04339
04340
04346 sciPointObj * sciGetSurface( sciPointObj * pObj )
04347 {
04348 sciSons * psonstmp;
04349 sciPointObj * sonSurface = NULL ;
04350
04351 psonstmp = sciGetSons( pObj ) ;
04352 while ( psonstmp != NULL )
04353 {
04354 if( sciGetEntityType( psonstmp->pointobj ) == SCI_SURFACE )
04355 {
04356
04357 return psonstmp->pointobj ;
04358 }
04359
04360 sonSurface = sciGetSurface( psonstmp->pointobj ) ;
04361 if ( sonSurface != NULL )
04362 {
04363 return sonSurface ;
04364 }
04365 psonstmp = psonstmp->pnext;
04366 }
04367
04368 return NULL;
04369 }
04370
04371 sciPointObj *CheckClickedSubwin(integer x, integer y)
04372 {
04373 integer box[4];
04374 sciSons *psonstmp;
04375 sciPointObj *psubwin;
04376
04377 psonstmp = sciGetSons (sciGetCurrentFigure());
04378 while (psonstmp != (sciSons *) NULL)
04379 {
04380 if(sciGetEntityType (psonstmp->pointobj) == SCI_SUBWIN)
04381 {
04382 psubwin= (sciPointObj *) psonstmp->pointobj;
04383 sciSetSelectedSubWin(psubwin);
04384 box[0]= Cscale.WIRect1[0];
04385 box[2]= Cscale.WIRect1[2]+Cscale.WIRect1[0];
04386 box[1]= Cscale.WIRect1[1];
04387 box[3]= Cscale.WIRect1[3]+Cscale.WIRect1[1];
04388 if ((x >= box[0]) && (x <= box[2]) && (y >= box[1]) && (y <= box[3]))
04389 return (sciPointObj *) psubwin;
04390 }
04391 psonstmp = psonstmp->pnext;
04392 }
04393 return (sciPointObj *) NULL;
04394 }
04395
04396
04397
04398
04399 int CheckForCompound(long *handelsvalue, int number)
04400 {
04401 sciPointObj *prevpparent;
04402 int i;
04403 long xtmp;
04404
04405 prevpparent = sciGetParent(sciGetPointerFromHandle((long) handelsvalue[0]));
04406
04407
04408 for (i=0;i<number;i++)
04409 {
04410 xtmp = handelsvalue[i];
04411
04412 switch (sciGetEntityType(sciGetPointerFromHandle(xtmp)))
04413 {
04414 case SCI_ARC:
04415 case SCI_RECTANGLE:
04416 case SCI_SEGS:
04417 case SCI_FEC:
04418 case SCI_GRAYPLOT:
04419 case SCI_POLYLINE:
04420 case SCI_TEXT:
04421 case SCI_TITLE:
04422 case SCI_LEGEND:
04423 case SCI_SURFACE:
04424 case SCI_AXES:
04425 case SCI_LIGHT:
04426
04427 if (
04428 (sciGetEntityType(sciGetParent(sciGetPointerFromHandle(xtmp))) != SCI_SUBWIN)
04429 ||
04430 (sciGetParent(sciGetPointerFromHandle(xtmp)) != prevpparent)
04431 )
04432 {
04433 return i+1;
04434 }
04435 break;
04436 case SCI_AGREG:
04437
04438 if (
04439 (
04440 (sciGetEntityType(sciGetParent(sciGetPointerFromHandle(xtmp))) != SCI_SUBWIN)
04441 &&
04442 (sciGetEntityType(sciGetParent(sciGetPointerFromHandle(xtmp))) != SCI_AGREG)
04443 )
04444 ||
04445 (sciGetParent(sciGetPointerFromHandle(xtmp)) != prevpparent)
04446 )
04447 {
04448 return i+1;
04449 }
04450 break;
04451
04452 case SCI_SUBWIN:
04453 case SCI_PANNER:
04454 case SCI_MENU:
04455 case SCI_MENUCONTEXT:
04456 case SCI_STATUSB:
04457 case SCI_FIGURE:
04458 case SCI_SBV:
04459 case SCI_SBH:
04460 case SCI_LABEL:
04461 case SCI_UIMENU:
04462 default:
04463 return -(i+1);
04464 }
04465 prevpparent = sciGetParent(sciGetPointerFromHandle(xtmp));
04466 }
04467 return 0;
04468 }
04469
04470
04471 sciPointObj *sciGetMerge(sciPointObj *psubwin)
04472 {
04473 sciSons *psonstmp;
04474
04475 psonstmp = sciGetSons (psubwin);
04476 while (psonstmp != (sciSons *) NULL)
04477 {
04478 if(sciGetEntityType (psonstmp->pointobj) == SCI_MERGE)
04479 return (sciPointObj *) psonstmp->pointobj;
04480 psonstmp = psonstmp->pnext;
04481 }
04482 return (sciPointObj *) NULL;
04483 }
04484
04485
04491 sciPointObj *
04492 sciGetOriginalSubWin (sciPointObj * pfigure)
04493 {
04494 return (sciPointObj *)pFIGURE_FEATURE(pfigure)->originalsubwin0011;
04495 }
04496
04497
04498
04499
04500
04501 HMENU
04502 sciGethPopMenu (sciPointObj * pthis)
04503 {
04504
04505
04506
04507
04508
04509 switch(sciGetEntityType(pthis)) {
04510 case SCI_SUBWIN:
04511 return sciGethPopMenu(pSUBWIN_FEATURE (pthis)->pPopMenu);
04512 break;
04513 case SCI_MENUCONTEXT:
04514 return pMENUCONTEXT_FEATURE(pthis)->hPopMenu;
04515 break;
04516 case SCI_FIGURE:
04517 case SCI_TEXT:
04518 case SCI_TITLE:
04519 case SCI_LEGEND:
04520 case SCI_ARC:
04521 case SCI_SEGS:
04522 case SCI_FEC:
04523 case SCI_GRAYPLOT:
04524 case SCI_POLYLINE:
04525 case SCI_RECTANGLE:
04526 case SCI_SURFACE:
04527 case SCI_LIGHT:
04528 case SCI_AXES:
04529 case SCI_PANNER:
04530 case SCI_SBH:
04531 case SCI_SBV:
04532 case SCI_MENU:
04533 case SCI_STATUSB:
04534 case SCI_AGREG:
04535 case SCI_LABEL:
04536 case SCI_UIMENU:
04537 default:
04538 return (HMENU) NULL ;
04539 break;
04540 }
04541 return (HMENU) NULL;
04542 }
04543
04544
04545 EAxesBoxType sciGetBoxType( sciPointObj * pobj )
04546 {
04547 switch (sciGetEntityType (pobj))
04548 {
04549 case SCI_SUBWIN:
04550 return pSUBWIN_FEATURE(pobj)->axes.rect ;
04551 default:
04552 sciprint ("This object has no box type \n") ;
04553 return (EAxesBoxType)0 ;
04554 }
04555 return (EAxesBoxType)0;
04556 }
04557
04558
04562 BOOL
04563 sciGetIsBoxed (sciPointObj * pobj)
04564 {
04565 switch (sciGetEntityType (pobj))
04566 {
04567 case SCI_TEXT:
04568 return pTEXT_FEATURE(pobj)->isboxed;
04569 break;
04570 case SCI_SUBWIN:
04571 return ( pSUBWIN_FEATURE(pobj)->axes.rect == BT_ON || pSUBWIN_FEATURE(pobj)->axes.rect == BT_BACK_HALF ) ;
04572 case SCI_LABEL:
04573 case SCI_POLYLINE:
04574 case SCI_RECTANGLE:
04575 case SCI_ARC:
04576 case SCI_FIGURE:
04577 case SCI_SURFACE:
04578 case SCI_AXES:
04579 case SCI_LEGEND:
04580 case SCI_SEGS:
04581 case SCI_FEC:
04582 case SCI_GRAYPLOT:
04583 case SCI_MENU:
04584 case SCI_MENUCONTEXT:
04585 case SCI_STATUSB:
04586 case SCI_LIGHT:
04587 case SCI_AGREG:
04588 case SCI_PANNER:
04589 case SCI_SBH:
04590 case SCI_SBV:
04591 case SCI_TITLE:
04592 case SCI_UIMENU:
04593 default:
04594 sciprint ("This object has no isboxed \n");
04595 return 0;
04596 break;
04597 }
04598 return 0;
04599 }
04600
04601 int *
04602 sciGetInterpVector(sciPointObj * pobj)
04603 {
04604
04605 if(sciGetEntityType(pobj) != SCI_POLYLINE)
04606 return (int *) NULL;
04607
04608 return pPOLYLINE_FEATURE(pobj)->scvector;
04609 }
04610
04611
04615 int
04616 sciGetPosition (sciPointObj * pobj, double *x, double *y)
04617 {
04618 switch ( sciGetEntityType (pobj) )
04619 {
04620 case SCI_LABEL:
04621 *x = sciGetTextPosX( pLABEL_FEATURE(pobj)->text ) ;
04622 *y = sciGetTextPosY( pLABEL_FEATURE(pobj)->text ) ;
04623 return 0;
04624 break;
04625 case SCI_POLYLINE:
04626 case SCI_RECTANGLE:
04627 case SCI_ARC:
04628 case SCI_TEXT:
04629 case SCI_FIGURE:
04630 case SCI_SUBWIN:
04631 case SCI_SURFACE:
04632 case SCI_AXES:
04633 case SCI_FEC:
04634 case SCI_SEGS:
04635 case SCI_LEGEND:
04636 case SCI_GRAYPLOT:
04637 case SCI_LIGHT:
04638 case SCI_MENU:
04639 case SCI_MENUCONTEXT:
04640 case SCI_STATUSB:
04641 case SCI_PANNER:
04642 case SCI_SBH:
04643 case SCI_SBV:
04644 case SCI_AGREG:
04645 case SCI_TITLE:
04646 case SCI_UIMENU:
04647 default:
04648 sciprint ("This object has no position\n");
04649 return -1;
04650 break;
04651 }
04652 return 0;
04653 }
04654
04655
04656 BOOL sciGetAutoRotation ( sciPointObj * pObj )
04657 {
04658 switch (sciGetEntityType (pObj))
04659 {
04660 case SCI_LABEL:
04661 return pLABEL_FEATURE(pObj)->auto_rotation ;
04662 break;
04663 case SCI_POLYLINE:
04664 case SCI_RECTANGLE:
04665 case SCI_ARC:
04666 case SCI_TEXT:
04667 case SCI_FIGURE:
04668 case SCI_SUBWIN:
04669 case SCI_SURFACE:
04670 case SCI_AXES:
04671 case SCI_FEC:
04672 case SCI_SEGS:
04673 case SCI_LEGEND:
04674 case SCI_GRAYPLOT:
04675 case SCI_LIGHT:
04676 case SCI_MENU:
04677 case SCI_MENUCONTEXT:
04678 case SCI_STATUSB:
04679 case SCI_PANNER:
04680 case SCI_SBH:
04681 case SCI_SBV:
04682 case SCI_AGREG:
04683 case SCI_TITLE:
04684 case SCI_UIMENU:
04685 default:
04686 return FALSE;
04687 break;
04688 }
04689 return FALSE;
04690 }
04691
04692 BOOL sciGetAutoPosition ( sciPointObj * pObj )
04693 {
04694 switch (sciGetEntityType (pObj))
04695 {
04696 case SCI_LABEL:
04697 return pLABEL_FEATURE(pObj)->auto_position ;
04698 break;
04699 case SCI_POLYLINE:
04700 case SCI_RECTANGLE:
04701 case SCI_ARC:
04702 case SCI_TEXT:
04703 case SCI_FIGURE:
04704 case SCI_SUBWIN:
04705 case SCI_SURFACE:
04706 case SCI_AXES:
04707 case SCI_FEC:
04708 case SCI_SEGS:
04709 case SCI_LEGEND:
04710 case SCI_GRAYPLOT:
04711 case SCI_LIGHT:
04712 case SCI_MENU:
04713 case SCI_MENUCONTEXT:
04714 case SCI_STATUSB:
04715 case SCI_PANNER:
04716 case SCI_SBH:
04717 case SCI_SBV:
04718 case SCI_AGREG:
04719 case SCI_TITLE:
04720 case SCI_UIMENU:
04721 default:
04722 return FALSE;
04723 break;
04724 }
04725 return FALSE;
04726 }
04727
04728
04729 BOOL sciGetLegendDefined( sciPointObj * pObj )
04730 {
04731 sciSubWindow * ppSubWin ;
04732 int xlNbRow ;
04733 int xlNbCol ;
04734 int ylNbRow ;
04735 int ylNbCol ;
04736 int zlNbRow ;
04737 int zlNbCol ;
04738
04739 if ( pObj == NULL )
04740 {
04741 return FALSE ;
04742 }
04743
04744 ppSubWin = pSUBWIN_FEATURE( pObj ) ;
04745
04746
04747 sciGetTextSize( ppSubWin->mon_x_label, &xlNbRow, &xlNbCol ) ;
04748 sciGetTextSize( ppSubWin->mon_y_label, &ylNbRow, &ylNbCol ) ;
04749 sciGetTextSize( ppSubWin->mon_z_label, &zlNbRow, &zlNbCol ) ;
04750
04751
04752 if ( xlNbRow <= 0 || ylNbRow <= 0 || zlNbRow <= 0 )
04753 {
04754 return FALSE ;
04755 }
04756 else
04757 {
04758 return TRUE ;
04759 }
04760 }
04761
04762 BOOL sciGetAutoSize( sciPointObj * pObj )
04763 {
04764 switch (sciGetEntityType (pObj))
04765 {
04766 case SCI_TEXT:
04767 return pTEXT_FEATURE(pObj)->autoSize ;
04768 break;
04769 default:
04770 return FALSE;
04771 break;
04772 }
04773 return FALSE;
04774 }
04775
04776 sciTextAlignment sciGetAlignment( sciPointObj * pObj )
04777 {
04778 switch (sciGetEntityType (pObj))
04779 {
04780 case SCI_TEXT:
04781 return pTEXT_FEATURE(pObj)->stringsAlign ;
04782 break;
04783 default:
04784 sciprint ("This object has no Text Alignment\n");
04785 return ALIGN_NONE ;
04786 }
04787 return ALIGN_NONE ;
04788 }
04789
04790 void sciGetUserSize( sciPointObj * pObj, double * width, double * height )
04791 {
04792 switch( sciGetEntityType( pObj ) )
04793 {
04794 case SCI_TEXT:
04795 *width = pTEXT_FEATURE(pObj)->userSize[0] ;
04796 *height = pTEXT_FEATURE(pObj)->userSize[1] ;
04797 break ;
04798 default:
04799 sciprint ("This object has no Specified Size\n");
04800 break ;
04801 }
04802 }
04803
04809 BOOL sciGetCenterPos( sciPointObj * pObj )
04810 {
04811 switch( sciGetEntityType( pObj ) )
04812 {
04813 case SCI_TEXT:
04814 return pTEXT_FEATURE(pObj)->centeredPos ;
04815 break ;
04816 default:
04817 sciprint ("This object has no centered position.\n");
04818 return FALSE ;
04819 }
04820 }
04821
04825 BOOL sciGetIs3d( sciPointObj * pObj )
04826 {
04827 switch( sciGetEntityType( pObj ) )
04828 {
04829 case SCI_SUBWIN:
04830 return pSUBWIN_FEATURE(pObj)->is3d ;
04831 case SCI_TEXT:
04832 return pTEXT_FEATURE( pObj )->is3d ;
04833 case SCI_LABEL:
04834 return sciGetIs3d( pLABEL_FEATURE( pObj )->text ) ;
04835 default:
04836 sciprint ("This object has no 3d mode.\n");
04837 return FALSE ;
04838 }
04839 return FALSE ;
04840 }
04841
04846 int sciGetNbChildren( sciPointObj * pObj )
04847 {
04848 int nbChildren = 0 ;
04849 sciSons * curSon = sciGetSons( pObj ) ;
04850 while ( curSon != NULL && curSon->pointobj != NULL )
04851 {
04852 nbChildren++ ;
04853 curSon = curSon->pnext ;
04854 }
04855 return nbChildren ;
04856 }
04857
04863 BOOL sciGetIsAccessibleChild( sciPointObj * pObj )
04864 {
04865 return sciGetEntityType( pObj ) != SCI_MERGE
04866 && sciGetEntityType( pObj ) != SCI_LABEL
04867 && GetHandleVisibilityOnUimenu( pObj ) ;
04868 }
04869
04874 int sciGetNbAccessibleChildren( sciPointObj * pObj )
04875 {
04876 int nbChildren = 0 ;
04877 sciSons * curSon = sciGetFirstAccessibleSon( pObj ) ;
04878
04879 while ( curSon != NULL && curSon->pointobj != NULL )
04880 {
04881 nbChildren++ ;
04882 curSon = sciGetNextAccessibleSon( curSon ) ;
04883 }
04884 return nbChildren ;
04885 }
04886
04887 BOOL GetHandleVisibilityOnUimenu( sciPointObj * pobj )
04888 {
04889 if (sciGetEntityType(pobj)!=SCI_UIMENU) { return TRUE ; }
04890
04891 return pUIMENU_FEATURE(pobj)->handle_visible;
04892 }
04893
04897 int sciGetSubwinNbSurf( sciPointObj * pSubwin )
04898 {
04899
04900 return pSUBWIN_FEATURE( pSubwin )->surfcounter ;
04901 }
04902
04909 int sciGetNbTypedObjects( sciPointObj * pObj, sciEntityType type )
04910 {
04911 int nbFound = 0 ;
04912 sciSons * curSon ;
04913
04914 curSon = sciGetSons( pObj ) ;
04915 while( curSon != NULL )
04916 {
04917 if ( sciGetEntityType( curSon->pointobj ) == type )
04918 {
04919 nbFound++ ;
04920 }
04921 nbFound += sciGetNbTypedObjects( curSon->pointobj, type ) ;
04922 curSon = curSon->pnext ;
04923 }
04924 return nbFound ;
04925 }
04926
04930 int sciGetHiddenColor( sciPointObj * pObj )
04931 {
04932 switch( sciGetEntityType( pObj ) )
04933 {
04934 case SCI_SUBWIN:
04935 return pSUBWIN_FEATURE(pObj)->hiddencolor ;
04936 case SCI_SURFACE:
04937 return pSURFACE_FEATURE(pObj)->hiddencolor ;
04938 default:
04939 sciprint ("This object has no hidden color.\n");
04940 return -10 ;
04941 }
04942 return -10 ;
04943 }
04944
04950 BOOL sciIsMergeable( sciPointObj * pObj )
04951 {
04952 switch (sciGetEntityType (pObj))
04953 {
04954 case SCI_SURFACE:
04955 return TRUE ;
04956 case SCI_POLYLINE:
04957 return TRUE ;
04958 case SCI_SEGS:
04959 return TRUE ;
04960 case SCI_RECTANGLE:
04961 return TRUE ;
04962 case SCI_MERGE:
04963 return TRUE ;
04964 default:
04965 return FALSE;
04966 break;
04967 }
04968 return FALSE;
04969 }
04970
04974 BOOL sciGetIsAutoDrawable( sciPointObj * pobj )
04975 {
04976 return pFIGURE_FEATURE(sciGetParentFigure(pobj))->auto_redraw ;
04977 }
04978
04982 void sciGetGridStyle( sciPointObj * pObj, int * xStyle, int * yStyle, int * zStyle )
04983 {
04984 switch ( sciGetEntityType (pObj) )
04985 {
04986 case SCI_SUBWIN:
04987 *xStyle = pSUBWIN_FEATURE(pObj)->grid[0] ;
04988 *yStyle = pSUBWIN_FEATURE(pObj)->grid[1] ;
04989 *zStyle = pSUBWIN_FEATURE(pObj)->grid[2] ;
04990 break ;
04991 default:
04992 sciprint( "This object has no grid property.\n" ) ;
04993 *xStyle = -1 ;
04994 *yStyle = -1 ;
04995 *zStyle = -1 ;
04996 }
04997 }
04998
05004 void sciGetViewport( sciPointObj * pObj, int * xSize, int * ySize )
05005 {
05006 switch ( sciGetEntityType(pObj) )
05007 {
05008 case SCI_FIGURE:
05009 if ( !sciGetResize(pObj) )
05010 {
05011 SciViewportGet( sciGetScilabXgc(pObj), xSize, ySize ) ;
05012 }
05013 else
05014 {
05015 *xSize = 0 ;
05016 *ySize = 0 ;
05017 }
05018 break ;
05019 default:
05020 sciprint( "This object has no viewport property.\n" ) ;
05021 *xSize = -1 ;
05022 *ySize = -1 ;
05023 }
05024 }
05025
05026 char * sciGetInfoMessage( sciPointObj * pObj )
05027 {
05028 switch ( sciGetEntityType(pObj) )
05029 {
05030 case SCI_FIGURE:
05031 return pFIGURE_FEATURE(pObj)->infoMessage ;
05032 default:
05033 sciprint( "This object has no info_message property.\n" ) ;
05034 return NULL ;
05035 }
05036 return NULL ;
05037 }
05038
05039 int sciGetInfoMessageLength( sciPointObj * pObj )
05040 {
05041 switch ( sciGetEntityType(pObj) )
05042 {
05043 case SCI_FIGURE:
05044 return strlen( pFIGURE_FEATURE(pObj)->infoMessage ) ;
05045 default:
05046 sciprint( "This object has no info_message property.\n" ) ;
05047 return -1 ;
05048 }
05049 return -1 ;
05050 }
05051
05052 void sciGetScreenPosition( sciPointObj * pObj, int * posX, int * posY )
05053 {
05054 switch ( sciGetEntityType(pObj) )
05055 {
05056 case SCI_FIGURE:
05057 {
05058 int num = sciGetNum(pObj) ;
05059 int cur = sciGetNum(sciGetCurrentFigure()) ;
05060 int verbose = 0 ;
05061 int na = 0 ;
05062 int pos[2] ;
05063 sciSetUsedWindow( num ) ;
05064 C2F(dr)("xget","wpos",&verbose,pos,&na,PI0,PI0,PI0,PD0,PD0,PD0,PD0,4L,4L);
05065 sciSetUsedWindow( cur ) ;
05066 *posX = pos[0] ;
05067 *posY = pos[1] ;
05068 }
05069 break ;
05070 case SCI_CONSOLE:
05071 *posX = -1 ;
05072 *posY = -1 ;
05073 case SCI_WINDOW:
05074 *posX = -1 ;
05075 *posY = -1 ;
05076 break ;
05077 default:
05078 sciprint( "This object has no position property.\n" ) ;
05079 *posX = -1 ;
05080 *posY = -1 ;
05081 }
05082 }
05083