/*--------------------------------------------------------------------------*/
static int getScalarFromStack(int paramIndex, char * funcName, double * res)
{
- int m = 0;
- int n = 0;
- size_t stackPointer = 0;
- if ( VarType(paramIndex) != sci_matrix )
- {
- Scierror(999,_("%s: Wrong type for input argument #%d: Real scalar expected.\n"), funcName, paramIndex);
- return -1 ;
- }
-
- /* get the handle */
- GetRhsVar( paramIndex, MATRIX_OF_DOUBLE_DATATYPE, &m, &n, &stackPointer );
-
- if ( m * n != 1 )
- {
- Scierror(999,_("%s: Wrong size for input argument #%d: Real scalar expected.\n"), funcName, paramIndex);
- return -1 ;
- }
-
- *res = getDoubleFromStack(stackPointer);
- return 0;
-}
-/*--------------------------------------------------------------------------*/
-int sci_stringbox( char * fname, unsigned long fname_len )
-{
- char* type = NULL;
- char* parentAxes = NULL;
- double* textCorners = NULL;
- int two = 2;
- int four = 4;
- size_t stackPointer = 0;
- double corners[4][2]; /* the four edges of the boundingRect */
-
- /* The function should be called with stringbox( handle ) */
- CheckRhs( 1, 6 );
- CheckLhs( 0, 1 );
-
- if (Rhs == 1)
- {
- int m;
- int n;
- /* A text handle should be specified */
-
- char * pTextUID = NULL;
- if ( VarType(1) != sci_handles )
+ int m = 0;
+ int n = 0;
+ size_t stackPointer = 0;
+ if ( VarType(paramIndex) != sci_matrix )
{
- Scierror(999,_("%s: Wrong type for input argument #%d: A 'Text' handle expected.\n"), fname, 1);
- return 0 ;
+ Scierror(999, _("%s: Wrong type for input argument #%d: Real scalar expected.\n"), funcName, paramIndex);
+ return -1 ;
}
/* get the handle */
- GetRhsVar( 1,GRAPHICAL_HANDLE_DATATYPE, &m, &n, &stackPointer );
+ GetRhsVar( paramIndex, MATRIX_OF_DOUBLE_DATATYPE, &m, &n, &stackPointer );
+
if ( m * n != 1 )
{
- Scierror(999,_("%s: Wrong size for input argument #%d: A 'Text' handle expected.\n"), fname, 1);
- return 0 ;
+ Scierror(999, _("%s: Wrong size for input argument #%d: Real scalar expected.\n"), funcName, paramIndex);
+ return -1 ;
}
- /* Get the handle and check that this is a text handle */
- pTextUID = (char*)getObjectFromHandle(getHandleFromStack(stackPointer));
-
- if ( pTextUID == NULL )
+ *res = *(stk(stackPointer));
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
+int sci_stringbox( char * fname, unsigned long fname_len )
+{
+ char* type = NULL;
+ char* parentAxes = NULL;
+ double* textCorners = NULL;
+ int two = 2;
+ int four = 4;
+ size_t stackPointer = 0;
+ double corners[4][2]; /* the four edges of the boundingRect */
+
+ /* The function should be called with stringbox( handle ) */
+ CheckRhs( 1, 6 );
+ CheckLhs( 0, 1 );
+
+ if (Rhs == 1)
{
- Scierror(999,_("%s: The handle is not valid.\n"),fname);
- return 0 ;
- }
+ int m;
+ int n;
+ /* A text handle should be specified */
- getGraphicObjectProperty(pTextUID, __GO_TYPE__, jni_string, (void **)&type);
+ char * pTextUID = NULL;
+ if ( VarType(1) != sci_handles )
+ {
+ Scierror(999, _("%s: Wrong type for input argument #%d: A 'Text' handle expected.\n"), fname, 1);
+ return 0 ;
+ }
- if (strcmp(type, __GO_LABEL__) != 0 && strcmp(type, __GO_TEXT__) != 0)
- {
- Scierror(999,_("%s: Wrong type for input argument #%d: A 'Text' handle expected.\n"), fname, 1);
- return 0;
- }
+ /* get the handle */
+ GetRhsVar( 1, GRAPHICAL_HANDLE_DATATYPE, &m, &n, &stackPointer );
+ if ( m * n != 1 )
+ {
+ Scierror(999, _("%s: Wrong size for input argument #%d: A 'Text' handle expected.\n"), fname, 1);
+ return 0 ;
+ }
- getGraphicObjectProperty(pTextUID, __GO_PARENT_AXES__, jni_string, (void **)&parentAxes);
-
- updateTextBounds(pTextUID);
-
- /*
- * To do: performs a projection/unprojection to obtain the bounding box in object coordinates
- * but using a rotation matrix corresponding to the default rotation angles (view == 2d)
- */
-
- getGraphicObjectProperty(pTextUID, __GO_CORNERS__, jni_double_vector, (void **)&textCorners);
-
- corners[1][0] = textCorners[0];
- corners[1][1] = textCorners[1];
-
- corners[0][0] = textCorners[3];
- corners[0][1] = textCorners[4];
-
- corners[3][0] = textCorners[6];
- corners[3][1] = textCorners[7];
-
- corners[2][0] = textCorners[9];
- corners[2][1] = textCorners[10];
- }
- else if (Rhs == 2)
- {
- Scierror(999,_("%s: Wrong number of input arguments: %d or %d to %d expected.\n"),fname, 1, 3, 6);
- return 0 ;
- }
- else
- {
- char * parentSubwinUID = (char*)getOrCreateDefaultSubwin();
- char ** text = NULL;
- int textNbRow;
- int textNbCol;
- double xPos;
- double yPos;
- double angle = DEFAULT_ANGLE;
- int fontId;
- int *pfontId = &fontId;
- double fontSize;
- double *pfontSize = &fontSize;
-
- getGraphicObjectProperty(parentSubwinUID, __GO_FONT_STYLE__, jni_int, (void**)&pfontId);
- getGraphicObjectProperty(parentSubwinUID, __GO_FONT_SIZE__, jni_double, (void **)&pfontSize);
-
- /* Check that first argument is a string */
- if ( VarType(1) != sci_strings )
- {
- Scierror(999,_("%s: Wrong type for input argument #%d: 2D array of strings expected.\n"), fname, 1);
- return 0 ;
- }
- GetRhsVar( 1, MATRIX_OF_STRING_DATATYPE, &textNbRow, &textNbCol, &stackPointer );
- /* retrieve it */
- text = getStringMatrixFromStack(stackPointer);
+ /* Get the handle and check that this is a text handle */
+ pTextUID = (char*)getObjectFromHandle(getHandleFromStack(stackPointer));
- /* Second and third arguments should be scalars */
- if (getScalarFromStack(2, fname, &xPos) < 0) { freeArrayOfString(text, textNbRow*textNbCol); return 0; }
- if (getScalarFromStack(3, fname, &yPos) < 0) { freeArrayOfString(text, textNbRow*textNbCol); return 0; }
+ if ( pTextUID == NULL )
+ {
+ Scierror(999, _("%s: The handle is not valid.\n"), fname);
+ return 0 ;
+ }
- if (Rhs >= 4)
- {
- /* angle is defined */
- if (getScalarFromStack(4, fname, &angle) < 0) { freeArrayOfString(text, textNbRow*textNbCol); return 0; }
- }
+ getGraphicObjectProperty(pTextUID, __GO_TYPE__, jni_string, (void **)&type);
+
+ if (strcmp(type, __GO_LABEL__) != 0 && strcmp(type, __GO_TEXT__) != 0)
+ {
+ Scierror(999, _("%s: Wrong type for input argument #%d: A 'Text' handle expected.\n"), fname, 1);
+ return 0;
+ }
+
+ getGraphicObjectProperty(pTextUID, __GO_PARENT_AXES__, jni_string, (void **)&parentAxes);
+
+ updateTextBounds(pTextUID);
+
+ /*
+ * To do: performs a projection/unprojection to obtain the bounding box in object coordinates
+ * but using a rotation matrix corresponding to the default rotation angles (view == 2d)
+ */
- if (Rhs >= 5)
+ getGraphicObjectProperty(pTextUID, __GO_CORNERS__, jni_double_vector, (void **)&textCorners);
+
+ corners[1][0] = textCorners[0];
+ corners[1][1] = textCorners[1];
+
+ corners[0][0] = textCorners[3];
+ corners[0][1] = textCorners[4];
+
+ corners[3][0] = textCorners[6];
+ corners[3][1] = textCorners[7];
+
+ corners[2][0] = textCorners[9];
+ corners[2][1] = textCorners[10];
+ }
+ else if (Rhs == 2)
{
- double fontIdD;
- /* font style is defined */
- if (getScalarFromStack(5, fname, &fontIdD) < 0) { freeArrayOfString(text, textNbRow*textNbCol); return 0; }
- fontId = (int) fontIdD;
+ Scierror(999, _("%s: Wrong number of input arguments: %d or %d to %d expected.\n"), fname, 1, 3, 6);
+ return 0 ;
}
-
- if (Rhs >= 6)
+ else
{
- /* font size is defined */
- if (getScalarFromStack(6, fname, &fontSize) < 0) { freeArrayOfString(text, textNbRow*textNbCol); return 0; }
+ char * parentSubwinUID = (char*)getOrCreateDefaultSubwin();
+ char ** text = NULL;
+ int textNbRow;
+ int textNbCol;
+ double xPos;
+ double yPos;
+ double angle = DEFAULT_ANGLE;
+ int fontId;
+ int *pfontId = &fontId;
+ double fontSize;
+ double *pfontSize = &fontSize;
+
+ getGraphicObjectProperty(parentSubwinUID, __GO_FONT_STYLE__, jni_int, (void**)&pfontId);
+ getGraphicObjectProperty(parentSubwinUID, __GO_FONT_SIZE__, jni_double, (void **)&pfontSize);
+
+ /* Check that first argument is a string */
+ if ( VarType(1) != sci_strings )
+ {
+ Scierror(999, _("%s: Wrong type for input argument #%d: 2D array of strings expected.\n"), fname, 1);
+ return 0 ;
+ }
+ GetRhsVar( 1, MATRIX_OF_STRING_DATATYPE, &textNbRow, &textNbCol, &stackPointer );
+ /* retrieve it */
+ text = getStringMatrixFromStack(stackPointer);
+
+ /* Second and third arguments should be scalars */
+ if (getScalarFromStack(2, fname, &xPos) < 0)
+ {
+ freeArrayOfString(text, textNbRow * textNbCol);
+ return 0;
+ }
+ if (getScalarFromStack(3, fname, &yPos) < 0)
+ {
+ freeArrayOfString(text, textNbRow * textNbCol);
+ return 0;
+ }
+
+ if (Rhs >= 4)
+ {
+ /* angle is defined */
+ if (getScalarFromStack(4, fname, &angle) < 0)
+ {
+ freeArrayOfString(text, textNbRow * textNbCol);
+ return 0;
+ }
+ }
+
+ if (Rhs >= 5)
+ {
+ double fontIdD;
+ /* font style is defined */
+ if (getScalarFromStack(5, fname, &fontIdD) < 0)
+ {
+ freeArrayOfString(text, textNbRow * textNbCol);
+ return 0;
+ }
+ fontId = (int) fontIdD;
+ }
+
+ if (Rhs >= 6)
+ {
+ /* font size is defined */
+ if (getScalarFromStack(6, fname, &fontSize) < 0)
+ {
+ freeArrayOfString(text, textNbRow * textNbCol);
+ return 0;
+ }
+ }
+
+ /* compute the box */
+ getTextBoundingBox(text, textNbRow, textNbCol, xPos, yPos, angle, fontId, fontSize, corners);
+ freeArrayOfString(text, textNbRow * textNbCol);
}
- /* compute the box */
- getTextBoundingBox(text, textNbRow, textNbCol, xPos, yPos, angle, fontId, fontSize, corners);
- freeArrayOfString(text, textNbRow*textNbCol);
- }
-
-
- /* copy everything into the lhs */
- stackPointer = 0; /* Fix for 64 bits: MSB of stackPointer has been set by GetRhsVar but are not reset by CreateVar */
- CreateVar( Rhs + 1,MATRIX_OF_DOUBLE_DATATYPE, &two, &four, &stackPointer );
- *stk( stackPointer ) = corners[1][0] ;
- *stk( stackPointer + 1 ) = corners[1][1] ;
- *stk( stackPointer + 2 ) = corners[0][0] ;
- *stk( stackPointer + 3 ) = corners[0][1] ;
- *stk( stackPointer + 4 ) = corners[3][0] ;
- *stk( stackPointer + 5 ) = corners[3][1] ;
- *stk( stackPointer + 6 ) = corners[2][0] ;
- *stk( stackPointer + 7 ) = corners[2][1] ;
-
- LhsVar( 1 ) = Rhs + 1 ;
- PutLhsVar();
- return 0;
+
+ /* copy everything into the lhs */
+ stackPointer = 0; /* Fix for 64 bits: MSB of stackPointer has been set by GetRhsVar but are not reset by CreateVar */
+ CreateVar( Rhs + 1, MATRIX_OF_DOUBLE_DATATYPE, &two, &four, &stackPointer );
+ *stk( stackPointer ) = corners[1][0] ;
+ *stk( stackPointer + 1 ) = corners[1][1] ;
+ *stk( stackPointer + 2 ) = corners[0][0] ;
+ *stk( stackPointer + 3 ) = corners[0][1] ;
+ *stk( stackPointer + 4 ) = corners[3][0] ;
+ *stk( stackPointer + 5 ) = corners[3][1] ;
+ *stk( stackPointer + 6 ) = corners[2][0] ;
+ *stk( stackPointer + 7 ) = corners[2][1] ;
+
+ LhsVar( 1 ) = Rhs + 1 ;
+ PutLhsVar();
+ return 0;
}
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
int sci_move( char * fname, unsigned long fname_len )
{
- int m1 = 0,n1 = 0,l1 = 0,m2 = 0,n2 = 0,l2 = 0,m3 = 0,n3 = 0,l3 = 0;
+ int m1 = 0, n1 = 0, l1 = 0, m2 = 0, n2 = 0, l2 = 0, m3 = 0, n3 = 0, l3 = 0;
int nbDim = 2;
BOOL alone = FALSE;
char* pobjUID = NULL;
double * moveVector = NULL;
- CheckRhs(2,3);
+ CheckRhs(2, 3);
/* set or create a graphic window */
- if (Rhs ==3)
+ if (Rhs == 3)
{
char * option = NULL;
- GetRhsVar(3,STRING_DATATYPE,&m3,&n3,&l3);
+ GetRhsVar(3, STRING_DATATYPE, &m3, &n3, &l3);
option = getStringFromStack(l3);
- if (strcmp(option,"alone") == 0)
+ if (strcmp(option, "alone") == 0)
{
alone = TRUE;
}
else
{
- Scierror(999,_("%s: Wrong value for input argument #%d: '%s' expected.\n"),fname,3, "alone");
+ Scierror(999, _("%s: Wrong value for input argument #%d: '%s' expected.\n"), fname, 3, "alone");
return 0;
}
}
if (pobjUID == NULL)
{
- Scierror(999,_("%s: The handle is not or no more valid.\n"),fname);
+ Scierror(999, _("%s: The handle is not or no more valid.\n"), fname);
return 0;
}
/* Get [x,y] or [x,y,z] vector */
- GetRhsVar(2,MATRIX_OF_DOUBLE_DATATYPE,&m2,&n2,&l2);
+ GetRhsVar(2, MATRIX_OF_DOUBLE_DATATYPE, &m2, &n2, &l2);
/* size of the vector, shoul dbe 2 or 3 */
- nbDim = m2*n2;
+ nbDim = m2 * n2;
if (nbDim != 2 && nbDim != 3)
{
- Scierror(999,_("%s: Wrong type for input argument #%d: Vector %s or %s expected.\n"),fname, 3, "[x y]","[x,y,z]");
+ Scierror(999, _("%s: Wrong type for input argument #%d: Vector %s or %s expected.\n"), fname, 3, "[x y]", "[x,y,z]");
return 0;
}
- moveVector = getDoubleMatrixFromStack(l2);
+ moveVector = stk(l2);
Objmove(pobjUID, moveVector, nbDim, alone);
/* pointer on the stack */
- rect = getDoubleMatrixFromStack(rectStackPointer);
+ rect = stk(rectStackPointer);
/* intialize to 0 */
for (i = 0; i < 4; i++)
#include "graphicObjectProperties.h"
#include "BuildObjects.h"
#include "CurrentSubwin.h"
+#include "sci_types.h"
/*--------------------------------------------------------------------------*/
-int sci_show_window( char *fname,unsigned long fname_len )
+int sci_show_window( char *fname, unsigned long fname_len )
{
char* pFigureUID = NULL;
char* pstrAxesUID = NULL;
- CheckRhs(0,1);
- CheckLhs(0,1);
+ CheckRhs(0, 1);
+ CheckLhs(0, 1);
if ( Rhs == 1 )
{
size_t stackPointer = 0 ;
char *type = NULL;
- if ( isParameterHandle( paramType ) )
+ if ( ( paramType == sci_handles ) )
{
/* by tis handle */
- GetRhsVar( 1,GRAPHICAL_HANDLE_DATATYPE, &nbRow, &nbCol, &stackPointer );
+ GetRhsVar( 1, GRAPHICAL_HANDLE_DATATYPE, &nbRow, &nbCol, &stackPointer );
if ( nbRow * nbCol != 1 )
{
- Scierror(999, _("%s: Wrong size for input argument #%d: A '%s' handle or a real scalar expected.\n"),fname, 1, "Figure");
+ Scierror(999, _("%s: Wrong size for input argument #%d: A '%s' handle or a real scalar expected.\n"), fname, 1, "Figure");
return -1 ;
}
if (pFigureUID == NULL)
{
- Scierror(999, _("%s: Handle does not or no longer exists.\n"),fname);
+ Scierror(999, _("%s: Handle does not or no longer exists.\n"), fname);
return -1 ;
}
getGraphicObjectProperty(pFigureUID, __GO_TYPE__, jni_string, (void **) &type);
if (strcmp(type, __GO_FIGURE__) != 0)
{
- Scierror(999, _("%s: Wrong type for input argument #%d: A '%s' handle or a real scalar expected.\n"),fname, 1, "Figure");
+ Scierror(999, _("%s: Wrong type for input argument #%d: A '%s' handle or a real scalar expected.\n"), fname, 1, "Figure");
return -1 ;
}
}
- else if ( isParameterDoubleMatrix( paramType ) )
+ else if ( ( paramType == sci_matrix ) )
{
/* by its number */
int winNum = 0;
- GetRhsVar(1,MATRIX_OF_DOUBLE_DATATYPE, &nbRow, &nbCol, &stackPointer );
+ GetRhsVar(1, MATRIX_OF_DOUBLE_DATATYPE, &nbRow, &nbCol, &stackPointer );
if ( nbRow * nbCol != 1 )
{
- Scierror(999, _("%s: Wrong size for input argument #%d: A '%s' handle or a real scalar expected.\n"),fname, 1, "Figure");
+ Scierror(999, _("%s: Wrong size for input argument #%d: A '%s' handle or a real scalar expected.\n"), fname, 1, "Figure");
return -1 ;
}
- winNum = (int) getDoubleFromStack(stackPointer);
+ winNum = (int) * (stk(stackPointer));
pFigureUID = (char*)getFigureFromIndex(winNum);
if (pFigureUID == NULL)
}
else
{
- Scierror(999, _("%s: Wrong type for input argument #%d: A '%s' handle or a real scalar expected.\n"),fname,1, "Figure");
+ Scierror(999, _("%s: Wrong type for input argument #%d: A '%s' handle or a real scalar expected.\n"), fname, 1, "Figure");
return -1;
}
}
/* Check that the requested figure really exists */
if ( pFigureUID == NULL )
{
- Scierror(999, _("%s: '%s' handle does not or no longer exists.\n"),fname,"Figure");
+ Scierror(999, _("%s: '%s' handle does not or no longer exists.\n"), fname, "Figure");
return -1 ;
}
#include "CurrentFigure.h"
/*--------------------------------------------------------------------------*/
-int sci_xdel(char *fname,unsigned long fname_len)
+int sci_xdel(char *fname, unsigned long fname_len)
{
- int m1 = 0,n1 = 0,l1 = 0;
+ int m1 = 0, n1 = 0, l1 = 0;
char *pstCurrentFigure = NULL;
- CheckRhs(-1,1);
- if (Rhs >= 1) {
+ CheckRhs(-1, 1);
+ if (Rhs >= 1)
+ {
int i = 0;
- double * windowNumbers = NULL;
- GetRhsVar(1,MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&l1);
+ double * windowNumbers = NULL;
+ GetRhsVar(1, MATRIX_OF_DOUBLE_DATATYPE, &m1, &n1, &l1);
- /* First check that all the window numbers are valid */
- windowNumbers = getDoubleMatrixFromStack(l1);
- for (i = 0; i < m1 * n1; i++)
- {
- if (!sciIsExistingFigure((int) windowNumbers[i]))
- {
- Scierror(999, "%s: Figure with figure_id %d does not exist.\n",fname, (int) windowNumbers[i]);
- return -1;
- }
- }
+ /* First check that all the window numbers are valid */
+ windowNumbers = stk(l1);
+ for (i = 0; i < m1 * n1; i++)
+ {
+ if (!sciIsExistingFigure((int) windowNumbers[i]))
+ {
+ Scierror(999, "%s: Figure with figure_id %d does not exist.\n", fname, (int) windowNumbers[i]);
+ return -1;
+ }
+ }
- for (i = 0; i < m1*n1 ; i++)
+ for (i = 0; i < m1 * n1 ; i++)
{
sciDeleteWindow( (int) windowNumbers[i] ) ;
}
deleteGraphicObject(pstCurrentFigure);
}
}
- LhsVar(1)=0;
+ LhsVar(1) = 0;
PutLhsVar();
return 0;
}
return FALSE;
}
- rectVect = getDoubleMatrixFromStack(stackPointer);
+ rectVect = stk(stackPointer);
for (i = 0; i < 4; i++)
{
rect[i] = rectVect[i];
#include "Scierror.h"
#include "stricmp.h"
/*--------------------------------------------------------------------------*/
-BOOL isParameterHandle( int type )
-{
- return ( type == sci_handles ) ;
-}
-/*--------------------------------------------------------------------------*/
-BOOL isParameterDoubleMatrix( int type )
-{
- return ( type == sci_matrix ) ;
-}
-/*--------------------------------------------------------------------------*/
-BOOL isParameterTlist( int type )
-{
- return ( type == sci_tlist ) ;
-}
-/*--------------------------------------------------------------------------*/
-BOOL isParameterStringMatrix( int type )
-{
- return ( type == sci_strings ) ;
-}
-/*--------------------------------------------------------------------------*/
double getDoubleFromStack( size_t stackPointer )
{
return *(stk( stackPointer ));
#include <stdlib.h> /* for size_t */
#include "dynlib_graphics.h"
+#include "sci_types.h"
#include "BOOL.h"
/*------------------------------------------------------------------------------*/
/* Basic type parameters */
-/**
- * return if a stack parameter is a Handle
- * @param type type of the parameter
- */
-GRAPHICS_IMPEXP BOOL isParameterHandle( int type ) ;
-
-/**
- * return if a stack parameter is a Handle
- * @param type type of the parameter
- */
-GRAPHICS_IMPEXP BOOL isParameterDoubleMatrix( int type ) ;
-
-/**
- * return if a stack parameter is a tlist
- * @param type type of the parameter
- **/
-GRAPHICS_IMPEXP BOOL isParameterTlist( int type ) ;
-
-/**
- * return if a stack parameter is a string matrix
- * @param type type of the parameter
- */
-GRAPHICS_IMPEXP BOOL isParameterStringMatrix( int type ) ;
/**
* retrieve a single double from the stack
BOOL status = FALSE;
int alignment = 0;
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "alignment");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"alignment");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "alignment");
return SET_PROPERTY_ERROR;
}
}
int quality = 0;
BOOL status = FALSE;
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "anti_aliasing");
return SET_PROPERTY_ERROR ;
BOOL status = FALSE;
int arcDrawingMethod = 0;
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "arc_drawing_method");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"arc_drawing_method");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "arc_drawing_method");
return SET_PROPERTY_ERROR;
}
BOOL status = FALSE;
double arrowSizeFactor = 0.;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real expected.\n"), "arrow_size_factor");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"arrow_size_factor");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "arrow_size_factor");
return SET_PROPERTY_ERROR;
}
}
BOOL status = FALSE;
double arrowSize = 0.;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real expected.\n"), "arrow_size");
return SET_PROPERTY_ERROR ;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"arrow_size");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "arrow_size");
return SET_PROPERTY_ERROR;
}
}
char* axesAutoTicksPropertiesNames[3] = {__GO_X_AXIS_AUTO_TICKS__, __GO_Y_AXIS_AUTO_TICKS__, __GO_Z_AXIS_AUTO_TICKS__};
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String matrix expected.\n"), "auto_ticks");
return SET_PROPERTY_ERROR ;
/*------------------------------------------------------------------------*/
int set_axes_bounds_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- BOOL status = FALSE;
- double axesBounds[4];
+ BOOL status = FALSE;
+ double axesBounds[4];
- if ( !isParameterDoubleMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "axes_bounds");
- return SET_PROPERTY_ERROR ;
- }
+ if ( !( valueType == sci_matrix ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "axes_bounds");
+ return SET_PROPERTY_ERROR ;
+ }
- if ( nbRow * nbCol != 4 )
- {
- Scierror(999, _("Wrong size for '%s' property: %d elements expected.\n"), "axes_bounds", 4);
- return SET_PROPERTY_ERROR ;
- }
+ if ( nbRow * nbCol != 4 )
+ {
+ Scierror(999, _("Wrong size for '%s' property: %d elements expected.\n"), "axes_bounds", 4);
+ return SET_PROPERTY_ERROR ;
+ }
- copyDoubleVectorFromStack( stackPointer, axesBounds, 4 );
+ copyDoubleVectorFromStack( stackPointer, axesBounds, 4 );
- status = setGraphicObjectProperty(pobjUID, __GO_AXES_BOUNDS__, axesBounds, jni_double_vector, 4);
+ status = setGraphicObjectProperty(pobjUID, __GO_AXES_BOUNDS__, axesBounds, jni_double_vector, 4);
- if (status == TRUE)
- {
- return SET_PROPERTY_SUCCEED;
- }
- else
- {
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"axes_bounds");
- return SET_PROPERTY_ERROR;
- }
+ if (status == TRUE)
+ {
+ return SET_PROPERTY_SUCCEED;
+ }
+ else
+ {
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "axes_bounds");
+ return SET_PROPERTY_ERROR;
+ }
}
/*------------------------------------------------------------------------*/
char ** values = getStringMatrixFromStack( stackPointer );
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String matrix expected.\n"), "axes_reverse");
return SET_PROPERTY_ERROR ;
/*------------------------------------------------------------------------*/
int set_axes_size_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- double * newWindowSize = getDoubleMatrixFromStack( stackPointer ) ;
- BOOL status = FALSE;
- int intValues[2];
-
- if ( !isParameterDoubleMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "axes_size");
- return SET_PROPERTY_ERROR ;
- }
-
- intValues[0] = (int) newWindowSize[0];
- intValues[1] = (int) newWindowSize[1];
-
- status = setGraphicObjectProperty(pobjUID, __GO_AXES_SIZE__, intValues, jni_int_vector, 2);
-
- if (status == TRUE)
- {
- return SET_PROPERTY_SUCCEED;
- }
- else
- {
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"axes_size");
- return SET_PROPERTY_ERROR;
- }
+ double * newWindowSize = stk( stackPointer ) ;
+ BOOL status = FALSE;
+ int intValues[2];
+
+ if ( !( valueType == sci_matrix ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "axes_size");
+ return SET_PROPERTY_ERROR ;
+ }
+
+ intValues[0] = (int) newWindowSize[0];
+ intValues[1] = (int) newWindowSize[1];
+
+ status = setGraphicObjectProperty(pobjUID, __GO_AXES_SIZE__, intValues, jni_int_vector, 2);
+
+ if (status == TRUE)
+ {
+ return SET_PROPERTY_SUCCEED;
+ }
+ else
+ {
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "axes_size");
+ return SET_PROPERTY_ERROR;
+ }
}
/*------------------------------------------------------------------------*/
char ** values = getStringMatrixFromStack( stackPointer );
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String matrix expected.\n"), "axes_visible");
return SET_PROPERTY_ERROR;
/*------------------------------------------------------------------------*/
int set_background_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- int value = 0;
- BOOL status = FALSE;
-
- if ( !isParameterDoubleMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "background");
- return SET_PROPERTY_ERROR ;
- }
-
- value = (int)getDoubleFromStack(stackPointer);
-
- status = setGraphicObjectProperty(pobjUID, __GO_BACKGROUND__, &value, jni_int, 1);
-
- if (status == TRUE)
- {
- return SET_PROPERTY_SUCCEED;
- }
- else
- {
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"background");
- return SET_PROPERTY_ERROR;
- }
+ int value = 0;
+ BOOL status = FALSE;
+
+ if ( !( valueType == sci_matrix ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "background");
+ return SET_PROPERTY_ERROR ;
+ }
+
+ value = (int)getDoubleFromStack(stackPointer);
+
+ status = setGraphicObjectProperty(pobjUID, __GO_BACKGROUND__, &value, jni_int, 1);
+
+ if (status == TRUE)
+ {
+ return SET_PROPERTY_SUCCEED;
+ }
+ else
+ {
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "background");
+ return SET_PROPERTY_ERROR;
+ }
}
/*------------------------------------------------------------------------*/
BOOL status = FALSE;
double barWidth = 0.;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real expected.\n"), "bar_width");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"bar_width");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "bar_width");
return SET_PROPERTY_ERROR;
}
BOOL status = FALSE;
char* type = NULL;
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "box");
return SET_PROPERTY_ERROR ;
BOOL status = FALSE;
double callbackType = 0.0;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: A Real scalar expected.\n"), "callback_type");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"callback_type");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "callback_type");
return SET_PROPERTY_ERROR;
}
}
BOOL status = FALSE;
int cdataMapping = 0;
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "cdata_mapping");
return SET_PROPERTY_ERROR;
if (status == FALSE)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"cdata_mapping");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "cdata_mapping");
return SET_PROPERTY_ERROR;
}
/*------------------------------------------------------------------------*/
int set_clip_box_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- BOOL status[2];
- int status1 = 0;
- int status2 = 0;
+ BOOL status[2];
+ int status1 = 0;
+ int status2 = 0;
- double* clipBox = NULL;
- /* 2: on */
- int clipState = 2;
+ double* clipBox = NULL;
+ /* 2: on */
+ int clipState = 2;
- if ( !isParameterDoubleMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "clip_box");
- return SET_PROPERTY_ERROR ;
- }
+ if ( !( valueType == sci_matrix ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "clip_box");
+ return SET_PROPERTY_ERROR ;
+ }
- /* We must have 4 elements */
- if ( nbRow * nbCol != 4 )
- {
- Scierror(999, _("Wrong size for '%s' property: %d elements expected.\n"), "clip_box", 4);
- return SET_PROPERTY_ERROR;
- }
+ /* We must have 4 elements */
+ if ( nbRow * nbCol != 4 )
+ {
+ Scierror(999, _("Wrong size for '%s' property: %d elements expected.\n"), "clip_box", 4);
+ return SET_PROPERTY_ERROR;
+ }
- clipBox = getDoubleMatrixFromStack(stackPointer);
+ clipBox = stk(stackPointer);
- status[0] = setGraphicObjectProperty(pobjUID, __GO_CLIP_BOX__, clipBox, jni_double_vector, 4);
- status[1] = setGraphicObjectProperty(pobjUID, __GO_CLIP_STATE__, &clipState, jni_int, 1);
+ status[0] = setGraphicObjectProperty(pobjUID, __GO_CLIP_BOX__, clipBox, jni_double_vector, 4);
+ status[1] = setGraphicObjectProperty(pobjUID, __GO_CLIP_STATE__, &clipState, jni_int, 1);
- if (status[0] == TRUE)
- {
- status1 = SET_PROPERTY_SUCCEED;
- }
- else
- {
- status1 = SET_PROPERTY_ERROR;
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"clip_box");
- }
+ if (status[0] == TRUE)
+ {
+ status1 = SET_PROPERTY_SUCCEED;
+ }
+ else
+ {
+ status1 = SET_PROPERTY_ERROR;
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "clip_box");
+ }
- if (status[1] == TRUE)
- {
- status2 = SET_PROPERTY_SUCCEED;
- }
- else
- {
- status2 = SET_PROPERTY_ERROR;
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"clip_box");
- }
+ if (status[1] == TRUE)
+ {
+ status2 = SET_PROPERTY_SUCCEED;
+ }
+ else
+ {
+ status2 = SET_PROPERTY_ERROR;
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "clip_box");
+ }
- return sciSetFinalStatus( (SetPropertyStatus)status1, (SetPropertyStatus)status2 );
+ return sciSetFinalStatus( (SetPropertyStatus)status1, (SetPropertyStatus)status2 );
}
/*------------------------------------------------------------------------*/
BOOL status = FALSE;
int clipState = 0;
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "clip_state");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"clip_state");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "clip_state");
return SET_PROPERTY_ERROR;
}
}
char* type = NULL;
int flagcolor = (int) getDoubleFromStack( stackPointer );
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real expected.\n"), "color_flag");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"color_flag");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "color_flag");
return SET_PROPERTY_ERROR;
}
{
BOOL status = FALSE;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "color_map");
return SET_PROPERTY_ERROR ;
}
- status = setGraphicObjectProperty(pobjUID, __GO_COLORMAP__, getDoubleMatrixFromStack(stackPointer), jni_double_vector, nbRow*nbCol);
+ status = setGraphicObjectProperty(pobjUID, __GO_COLORMAP__, stk(stackPointer), jni_double_vector, nbRow * nbCol);
if (status == TRUE)
{
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"color_map");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "color_map");
return SET_PROPERTY_ERROR;
}
}
BOOL status = FALSE;
int colorMode = 0;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "color_mode");
return SET_PROPERTY_ERROR;
if (status == FALSE)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"color_mode");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "color_mode");
return SET_PROPERTY_ERROR;
}
int values[2];
int nbColors = 0;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "color_range");
return SET_PROPERTY_ERROR;
nbColors = sciGetNumColors(pobjUID);
if ( values[0] > nbColors || values[0] < 0
- || values[1] > nbColors || values[1] < 0)
+ || values[1] > nbColors || values[1] < 0)
{
/* It is possible to set color_range outside the colormap, however it won't be used.*/
sciprint(_("WARNING: Wrong value for '%s' property: indices outside the colormap will be clamped.\n"), "color_range");
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"color_range");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "color_range");
return SET_PROPERTY_ERROR;
}
}
#include "localization.h"
#include "SetPropertyStatus.h"
#include "HandleManagement.h"
+#include "sci_types.h"
#include "getGraphicObjectProperty.h"
#include "setGraphicObjectProperty.h"
return SET_PROPERTY_ERROR;
}
- if ( !isParameterHandle( valueType ) )
+ if ( !( valueType == sci_handles ) )
{
Scierror(999, _("Wrong type for '%s' property: Handle expected.\n"), "current_axes");
return SET_PROPERTY_ERROR;
#include "SetPropertyStatus.h"
#include "CurrentObject.h"
#include "HandleManagement.h"
+#include "sci_types.h"
/*------------------------------------------------------------------------*/
int set_current_entity_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
char* curEntity = NULL ;
- if (pobjUID != NULL)
- {
- /* This property should not be called on an handle */
- Scierror(999, _("'%s' property does not exist for this handle.\n"), "current_entity");
- return -1;
- }
+ if (pobjUID != NULL)
+ {
+ /* This property should not be called on an handle */
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "current_entity");
+ return -1;
+ }
- if ( !isParameterHandle( valueType ) )
+ if ( !( valueType == sci_handles ) )
{
Scierror(999, _("Wrong type for '%s' property: Handle expected.\n"), "current_entity");
return SET_PROPERTY_ERROR ;
#include "localization.h"
#include "SetPropertyStatus.h"
#include "HandleManagement.h"
+#include "sci_types.h"
#include "BuildObjects.h"
#include "CurrentFigure.h"
char* curFigUID = NULL;
char* pstrAxesUID = NULL;
- if (pobjUID != NULL)
- {
- /* This property should not be called on an handle */
- Scierror(999, _("'%s' property does not exist for this handle.\n"), "current_figure");
- return SET_PROPERTY_ERROR;
- }
+ if (pobjUID != NULL)
+ {
+ /* This property should not be called on an handle */
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "current_figure");
+ return SET_PROPERTY_ERROR;
+ }
if (nbRow * nbCol != 1)
{
return SET_PROPERTY_ERROR ;
}
- if ( isParameterHandle( valueType ) )
+ if ( ( valueType == sci_handles ) )
{
curFigUID = (char*)getObjectFromHandle( getHandleFromStack( stackPointer ) ) ;
if ( curFigUID == NULL )
{
- Scierror(999, _("'%s' handle does not or no longer exists.\n"),"Figure");
+ Scierror(999, _("'%s' handle does not or no longer exists.\n"), "Figure");
return SET_PROPERTY_ERROR ;
}
setCurrentFigure(curFigUID);
return 0;
}
- else if ( isParameterDoubleMatrix( valueType ) )
+ else if ( ( valueType == sci_matrix ) )
{
figNum = (int) getDoubleFromStack( stackPointer ) ;
}
else
{
- Scierror(999, _("Wrong type for '%s' property: Real or '%s' handle expected.\n"), "current_figure","Figure") ;
+ Scierror(999, _("Wrong type for '%s' property: Real or '%s' handle expected.\n"), "current_figure", "Figure") ;
return SET_PROPERTY_ERROR ;
}
double * yMin, double * yMax,
double * zMin, double * zMax )
{
- double * bounds = getDoubleMatrixFromStack( stackPointer ) ;
-
- /* initialize zMin and zMax to avoid checking between 2D and 3D */
- *zMin = 1.0 ;
- *zMax = 2.0 ;
-
- if( nbRow==3 ) /* Remove the 3x2 case */
- {
- Scierror(999, _("Wrong size for '%s' property: Must be in the set {%s}.\n"), "data_bounds", "1x4, 1x6, 2x2, 2x3, 4x1, 6x1");
- return SET_PROPERTY_ERROR ;
- }
-
- switch ( nbRow*nbCol )
- {
- case 4 : /* 2D case */
- *xMin = bounds[0] ;
- *xMax = bounds[1] ;
- *yMin = bounds[2] ;
- *yMax = bounds[3] ;
- break;
-
- case 6 : /* 3D case */
- *xMin = bounds[0] ;
- *xMax = bounds[1] ;
- *yMin = bounds[2] ;
- *yMax = bounds[3] ;
- *zMin = bounds[4] ;
- *zMax = bounds[5] ;
- break ;
- default:
- Scierror(999, _("Wrong size for '%s' property: Must be in the set {%s}.\n"), "data_bounds", "1x4, 1x6, 2x2, 2x3, 4x1, 6x1");
- return SET_PROPERTY_ERROR ;
- }
- return SET_PROPERTY_SUCCEED ;
+ double * bounds = stk( stackPointer ) ;
+
+ /* initialize zMin and zMax to avoid checking between 2D and 3D */
+ *zMin = 1.0 ;
+ *zMax = 2.0 ;
+
+ if ( nbRow == 3 ) /* Remove the 3x2 case */
+ {
+ Scierror(999, _("Wrong size for '%s' property: Must be in the set {%s}.\n"), "data_bounds", "1x4, 1x6, 2x2, 2x3, 4x1, 6x1");
+ return SET_PROPERTY_ERROR ;
+ }
+
+ switch ( nbRow * nbCol )
+ {
+ case 4 : /* 2D case */
+ *xMin = bounds[0] ;
+ *xMax = bounds[1] ;
+ *yMin = bounds[2] ;
+ *yMax = bounds[3] ;
+ break;
+
+ case 6 : /* 3D case */
+ *xMin = bounds[0] ;
+ *xMax = bounds[1] ;
+ *yMin = bounds[2] ;
+ *yMax = bounds[3] ;
+ *zMin = bounds[4] ;
+ *zMax = bounds[5] ;
+ break ;
+ default:
+ Scierror(999, _("Wrong size for '%s' property: Must be in the set {%s}.\n"), "data_bounds", "1x4, 1x6, 2x2, 2x3, 4x1, 6x1");
+ return SET_PROPERTY_ERROR ;
+ }
+ return SET_PROPERTY_SUCCEED ;
}
/*------------------------------------------------------------------------*/
double zMax = 0. ;
int firstPlot = 0;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "data_bounds");
return SET_PROPERTY_ERROR;
/* get the bounds */
if ( getdDataBoundsFromStack( stackPointer, nbRow, nbCol, &xMin, &xMax, &yMin, &yMax, &zMin, &zMax ) == SET_PROPERTY_ERROR )
{
- return SET_PROPERTY_ERROR ;
+ return SET_PROPERTY_ERROR ;
}
/* To be implemented within the MVC */
if (tmpBounds == NULL)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"data_bounds");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "data_bounds");
return SET_PROPERTY_ERROR;
}
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"data_bounds");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "data_bounds");
return SET_PROPERTY_ERROR;
}
}
BOOL status = FALSE;
int dataMapping = 0;
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "data_mapping");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"data_mapping");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "data_mapping");
return SET_PROPERTY_ERROR;
}
#include "BasicAlgos.h"
#include "set_data_property.h"
#include "MALLOC.h"
+#include "sci_types.h"
#include "graphicObjectProperties.h"
#include "setGraphicObjectProperty.h"
/* check dim */
if ( nbCol[0] != 1 || nbCol[1] != 1 )
{
- Scierror(999, _("%s: Wrong type for argument #%d: Columns vectors expected.\n"),"Tlist",1);
+ Scierror(999, _("%s: Wrong type for argument #%d: Columns vectors expected.\n"), "Tlist", 1);
return SET_PROPERTY_ERROR;
}
- numberArrows = nbRow[0]*nbRow[1];
+ numberArrows = nbRow[0] * nbRow[1];
dimensions[0] = nbRow[0];
dimensions[1] = nbRow[1];
if ( nbRow[2] != nbRow[0] || nbCol[2] != nbRow[1] || nbRow[3] != nbRow[2] || nbCol[3] != nbCol[2] )
{
- Scierror(999, _("%s: Wrong size for arguments #%d and #%d: Incompatible length.\n"),"Tlist",3,4);
+ Scierror(999, _("%s: Wrong size for arguments #%d and #%d: Incompatible length.\n"), "Tlist", 3, 4);
return SET_PROPERTY_ERROR;
}
if ( nbCol[0] != 1 || nbCol[1] != 1 )
{
- Scierror(999, _("%s: Wrong type for argument #%d: Columns vectors expected.\n"),"Tlist",1);
+ Scierror(999, _("%s: Wrong type for argument #%d: Columns vectors expected.\n"), "Tlist", 1);
return SET_PROPERTY_ERROR;
}
if ( nbRow[2] != nbRow[0] || nbCol[2] != nbRow[1] )
{
- Scierror(999, _("%s: Wrong size for arguments #%d: Incompatible length.\n"),"Tlist",3);
+ Scierror(999, _("%s: Wrong size for arguments #%d: Incompatible length.\n"), "Tlist", 3);
/* Was previously: */
#if 0
- Scierror(999, _("%s: Wrong size for arguments #%d: Incompatible length.\n"),"Tlist","Tlist",3);
+ Scierror(999, _("%s: Wrong size for arguments #%d: Incompatible length.\n"), "Tlist", "Tlist", 3);
#endif
return 0;
}
{
if ( !(m1 == m2 && m2 == m3 && n1 == n2 && n2 == n3) )
{
- Scierror(999, _("%s: Wrong size for arguments #%d, #%d and #%d: Incompatible length.\n"),"Tlist",1,2,3);
+ Scierror(999, _("%s: Wrong size for arguments #%d, #%d and #%d: Incompatible length.\n"), "Tlist", 1, 2, 3);
return SET_PROPERTY_ERROR;
}
}
{
if ( m2 * n2 != n3 )
{
- Scierror(999, _("%s: Wrong size for arguments #%d and #%d: Incompatible length.\n"),"Tlist",2,3);
+ Scierror(999, _("%s: Wrong size for arguments #%d and #%d: Incompatible length.\n"), "Tlist", 2, 3);
return SET_PROPERTY_ERROR;
}
if ( m1 * n1 != m3 )
{
- Scierror(999, _("%s: Wrong size for arguments #%d and #%d: Incompatible length.\n"),"Tlist",1,3);
+ Scierror(999, _("%s: Wrong size for arguments #%d and #%d: Incompatible length.\n"), "Tlist", 1, 3);
return SET_PROPERTY_ERROR;
}
if ( m1 * n1 <= 1 || m2 * n2 <= 1 )
{
- Scierror(999, _("%s: Wrong size for arguments #%d and #%d: Should be >= %d.\n"),"Tlist",1,2,2);
+ Scierror(999, _("%s: Wrong size for arguments #%d and #%d: Should be >= %d.\n"), "Tlist", 1, 2, 2);
return SET_PROPERTY_ERROR;
}
}
/* case isfac=1;*/
if (isFac3d == 0)
{
- Scierror(999, _("Can not change the %s of graphic object: its type is %s.\n"),"typeof3d","SCI_PLOT3D");
+ Scierror(999, _("Can not change the %s of graphic object: its type is %s.\n"), "typeof3d", "SCI_PLOT3D");
return SET_PROPERTY_ERROR;
}
}
/* case isfac=0;*/
if (isFac3d == 1)
{
- Scierror(999, _("Can not change the %s of graphic object: its type is %s.\n"),"typeof3d","SCI_FAC3D");
+ Scierror(999, _("Can not change the %s of graphic object: its type is %s.\n"), "typeof3d", "SCI_FAC3D");
return SET_PROPERTY_ERROR;
}
}
int monotony = checkMonotony( pvecx, dimvectx );
if ( monotony == 0 )
{
- Scierror(999, _("%s: Wrong value: Vector is not monotonous.\n"),"Objplot3d");
+ Scierror(999, _("%s: Wrong value: Vector is not monotonous.\n"), "Objplot3d");
return SET_PROPERTY_ERROR;
}
/* x is considered as a matrix */
dimvecty = -1;
}
- else if(m2 == 1) /* y is a row vector */
+ else if (m2 == 1) /* y is a row vector */
{
dimvecty = n2;
}
- else if(n2 == 1) /* y is a column vector */
+ else if (n2 == 1) /* y is a column vector */
{
dimvecty = m2;
}
dimvecty = -1;
}
- if( dimvecty > 1 )
+ if ( dimvecty > 1 )
{
int monotony = checkMonotony( pvecy, dimvecty );
if ( monotony == 0 )
{
- Scierror(999, _("%s: Wrong value: Vector is not monotonous.\n"),"Objplot3d");
+ Scierror(999, _("%s: Wrong value: Vector is not monotonous.\n"), "Objplot3d");
return SET_PROPERTY_ERROR;
}
}
}
- setGraphicObjectProperty(pobjUID, __GO_DATA_MODEL_X__, pvecx, jni_double_vector, m1*n1);
- setGraphicObjectProperty(pobjUID, __GO_DATA_MODEL_Y__, pvecy, jni_double_vector, m2*n2);
- setGraphicObjectProperty(pobjUID, __GO_DATA_MODEL_Z__, pvecz, jni_double_vector, m3*n3);
+ setGraphicObjectProperty(pobjUID, __GO_DATA_MODEL_X__, pvecx, jni_double_vector, m1 * n1);
+ setGraphicObjectProperty(pobjUID, __GO_DATA_MODEL_Y__, pvecy, jni_double_vector, m2 * n2);
+ setGraphicObjectProperty(pobjUID, __GO_DATA_MODEL_Z__, pvecz, jni_double_vector, m3 * n3);
- if( getAssignedListNbElement( tlist ) == 4 ) /* F.Leray There is a color matrix */
+ if ( getAssignedListNbElement( tlist ) == 4 ) /* F.Leray There is a color matrix */
{
inputColors = getCurrentDoubleMatrixFromList( tlist, &m3n, &n3n );
nbInputColors = m3n * n3n;
AssignedList* tlist = NULL;
int status = -1;
- if( !isParameterTlist( valueType ) )
+ if ( !(valueType == sci_tlist ))
{
Scierror(999, "Incorrect argument, must be a Tlist!\n");
return SET_PROPERTY_ERROR;
AssignedList * tlist = NULL;
int status = -1;
- if( !isParameterTlist( valueType ) )
+ if ( !(valueType == sci_tlist ))
{
Scierror(999, _("Wrong type for input argument: Tlist expected.\n"));
return SET_PROPERTY_ERROR;
int status = -1;
int listSize = 0;
- if( !isParameterTlist( valueType ) )
+ if ( !(valueType == sci_tlist ))
{
Scierror(999, _("Wrong type for input argument: Tlist expected.\n"));
return SET_PROPERTY_ERROR ;
}
else
{
- Scierror(999, _("Wrong size for input argument: %d or %d expected.\n"),4,5);
+ Scierror(999, _("Wrong size for input argument: %d or %d expected.\n"), 4, 5);
return SET_PROPERTY_ERROR;
}
}
else /* F.Leray 02.05.05 : "data" case for others (using sciGetPoint routine inside GetProperty.c) */
{
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
- Scierror(999, _("Incompatible type for property %s.\n"),"data");
+ Scierror(999, _("Incompatible type for property %s.\n"), "data");
return SET_PROPERTY_ERROR;
}
- return sciSetPoint( pobjUID, getDoubleMatrixFromStack( stackPointer ), &nbRow, &nbCol );
+ return sciSetPoint( pobjUID, stk( stackPointer ), &nbRow, &nbCol );
}
return SET_PROPERTY_ERROR;
/*------------------------------------------------------------------------*/
int set_default_values_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real expected.\n"), "default_values");
return SET_PROPERTY_ERROR ;
/*------------------------------------------------------------------------*/
int set_event_handler_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- BOOL status = FALSE;
- int bEnable = FALSE;
- char *pstHandler = NULL;
+ BOOL status = FALSE;
+ int bEnable = FALSE;
+ char *pstHandler = NULL;
- if ( !isParameterStringMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "event_handler");
- return SET_PROPERTY_ERROR ;
- }
+ if ( !( valueType == sci_strings ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "event_handler");
+ return SET_PROPERTY_ERROR ;
+ }
- pstHandler = getStringFromStack(stackPointer);
- status = setGraphicObjectProperty(pobjUID, __GO_EVENTHANDLER_NAME__, pstHandler, jni_string, 1);
+ pstHandler = getStringFromStack(stackPointer);
+ status = setGraphicObjectProperty(pobjUID, __GO_EVENTHANDLER_NAME__, pstHandler, jni_string, 1);
- if (strlen(pstHandler) == 0)
- {
- // f.event_handler = "" => f.event_handler_enable = "off"
- status = setGraphicObjectProperty(pobjUID, __GO_EVENTHANDLER_ENABLE__, &bEnable, jni_bool, 1);
- }
+ if (strlen(pstHandler) == 0)
+ {
+ // f.event_handler = "" => f.event_handler_enable = "off"
+ status = setGraphicObjectProperty(pobjUID, __GO_EVENTHANDLER_ENABLE__, &bEnable, jni_bool, 1);
+ }
- if (status == TRUE)
- {
- return SET_PROPERTY_SUCCEED;
- }
- else
- {
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"event_handler");
- return SET_PROPERTY_ERROR;
- }
+ if (status == TRUE)
+ {
+ return SET_PROPERTY_SUCCEED;
+ }
+ else
+ {
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "event_handler");
+ return SET_PROPERTY_ERROR;
+ }
}
/*------------------------------------------------------------------------*/
{
BOOL status = FALSE;
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "closerequestfcn");
return SET_PROPERTY_ERROR ;
int id = 0;
BOOL status = FALSE;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "figure_id");
return SET_PROPERTY_ERROR ;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"figure_id");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "figure_id");
return SET_PROPERTY_ERROR;
}
#include "Scierror.h"
#include "localization.h"
#include "SetPropertyStatus.h"
+#include "sci_types.h"
#include "setGraphicObjectProperty.h"
#include "graphicObjectProperties.h"
{
BOOL status = FALSE;
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "figure_name");
return SET_PROPERTY_ERROR ;
status = setGraphicObjectProperty(pobjUID, __GO_NAME__, getStringFromStack( stackPointer ), jni_string, 1);
- if(status == TRUE)
+ if (status == TRUE)
{
return SET_PROPERTY_SUCCEED;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"figure_name");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "figure_name");
return SET_PROPERTY_ERROR;
}
}
{
BOOL status = FALSE;
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "resizefcn");
return SET_PROPERTY_ERROR ;
/*------------------------------------------------------------------------*/
int set_figure_size_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- double * values = getDoubleMatrixFromStack( stackPointer ) ;
- BOOL status = FALSE;
- int intValues[2];
+ double * values = stk( stackPointer ) ;
+ BOOL status = FALSE;
+ int intValues[2];
- if ( !isParameterDoubleMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "figure_size");
- return SET_PROPERTY_ERROR ;
- }
+ if ( !( valueType == sci_matrix ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "figure_size");
+ return SET_PROPERTY_ERROR ;
+ }
- if ( nbRow * nbCol != 2 )
- {
- Scierror(999, _("Wrong size for '%s' property: %d elements expected.\n"),"figure_size",2) ;
- return SET_PROPERTY_ERROR ;
- }
+ if ( nbRow * nbCol != 2 )
+ {
+ Scierror(999, _("Wrong size for '%s' property: %d elements expected.\n"), "figure_size", 2) ;
+ return SET_PROPERTY_ERROR ;
+ }
- intValues[0] = (int)values[0];
- intValues[1] = (int)values[1];
+ intValues[0] = (int)values[0];
+ intValues[1] = (int)values[1];
- status = setGraphicObjectProperty(pobjUID, __GO_SIZE__, intValues, jni_int_vector, 2);
+ status = setGraphicObjectProperty(pobjUID, __GO_SIZE__, intValues, jni_int_vector, 2);
- if (status == TRUE)
- {
- return SET_PROPERTY_SUCCEED;
- }
- else
- {
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"figure_size");
- return SET_PROPERTY_ERROR;
- }
+ if (status == TRUE)
+ {
+ return SET_PROPERTY_SUCCEED;
+ }
+ else
+ {
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "figure_size");
+ return SET_PROPERTY_ERROR;
+ }
}
/*------------------------------------------------------------------------*/
int set_figure_style_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- if ( !isParameterStringMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "figure_style");
- return SET_PROPERTY_ERROR ;
- }
+ if ( !( valueType == sci_strings ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "figure_style");
+ return SET_PROPERTY_ERROR ;
+ }
- if ( isStringParamEqual( stackPointer, "old" ) )
- {
- Scierror(999, _("Old graphic mode is no longer available. Please refer to the set help page.\n")) ;
- return SET_PROPERTY_ERROR ;
- }
- else if ( isStringParamEqual( stackPointer, "new" ) )
- {
- /* graphic mode must be new */
- /* nothing to do */
- return SET_PROPERTY_UNCHANGED ;
- }
- else
- {
- Scierror(999, _("Wrong value for '%s' property: %s or %s expected.\n"), "figure_style", "'old'", "'new'");
+ if ( isStringParamEqual( stackPointer, "old" ) )
+ {
+ Scierror(999, _("Old graphic mode is no longer available. Please refer to the set help page.\n")) ;
+ return SET_PROPERTY_ERROR ;
+ }
+ else if ( isStringParamEqual( stackPointer, "new" ) )
+ {
+ /* graphic mode must be new */
+ /* nothing to do */
+ return SET_PROPERTY_UNCHANGED ;
+ }
+ else
+ {
+ Scierror(999, _("Wrong value for '%s' property: %s or %s expected.\n"), "figure_style", "'old'", "'new'");
- }
- return SET_PROPERTY_ERROR ;
+ }
+ return SET_PROPERTY_ERROR ;
}
/*------------------------------------------------------------------------*/
BOOL status = FALSE;
double fontAngle = 0.;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real expected.\n"), "font_angle");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"font_angle");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "font_angle");
return SET_PROPERTY_ERROR;
}
BOOL status = FALSE;
int value = 0;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "font_color");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"font_color");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "font_color");
return SET_PROPERTY_ERROR;
}
BOOL status = FALSE;
int value = 0;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "font_foreground");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"font_foreground");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "font_foreground");
return SET_PROPERTY_ERROR;
}
BOOL status = FALSE;
double fontSize = 0.;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real expected.\n"), "font_size");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"font_size");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "font_size");
return SET_PROPERTY_ERROR;
}
}
/* number of fonts available */
int nbInstalledFonts = getNbInstalledFonts();
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "font_style");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"font_style");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "font_style");
return SET_PROPERTY_ERROR;
}
BOOL status = FALSE;
int lineColor = 0;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "foreground");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"foreground");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "foreground");
return SET_PROPERTY_ERROR;
}
}
{
BOOL status = FALSE;
char* format = NULL;
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "format_n");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"format_n");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "format_n");
return SET_PROPERTY_ERROR;
}
}
/*------------------------------------------------------------------------*/
int set_grid_position_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- BOOL status = FALSE;
- int position = 0;
+ BOOL status = FALSE;
+ int position = 0;
- if ( !isParameterStringMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "grid_position");
- return SET_PROPERTY_ERROR ;
- }
+ if ( !( valueType == sci_strings ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "grid_position");
+ return SET_PROPERTY_ERROR ;
+ }
- if ( isStringParamEqual( stackPointer, "foreground" ) )
- {
- position = 1;
- }
- else if ( isStringParamEqual( stackPointer, "background" ) )
- {
- position = 0;
- }
- else
- {
- Scierror(999, _("Wrong value for '%s' property: %s or %s expected.\n"), "grid_position", "foreground", "background");
- return SET_PROPERTY_ERROR ;
- }
+ if ( isStringParamEqual( stackPointer, "foreground" ) )
+ {
+ position = 1;
+ }
+ else if ( isStringParamEqual( stackPointer, "background" ) )
+ {
+ position = 0;
+ }
+ else
+ {
+ Scierror(999, _("Wrong value for '%s' property: %s or %s expected.\n"), "grid_position", "foreground", "background");
+ return SET_PROPERTY_ERROR ;
+ }
- status = setGraphicObjectProperty(pobjUID, __GO_GRID_POSITION__, &position, jni_int, 1);
+ status = setGraphicObjectProperty(pobjUID, __GO_GRID_POSITION__, &position, jni_int, 1);
- if (status == TRUE)
- {
- return SET_PROPERTY_SUCCEED;
- }
- else
- {
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"grid_position") ;
- return SET_PROPERTY_ERROR;
- }
+ if (status == TRUE)
+ {
+ return SET_PROPERTY_SUCCEED;
+ }
+ else
+ {
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "grid_position") ;
+ return SET_PROPERTY_ERROR;
+ }
}
/*------------------------------------------------------------------------*/
int gridStyles[3];
char* gridColorPropertiesNames[3] = {__GO_X_AXIS_GRID_COLOR__, __GO_Y_AXIS_GRID_COLOR__, __GO_Z_AXIS_GRID_COLOR__};
- double * values = getDoubleMatrixFromStack( stackPointer );
+ double * values = stk( stackPointer );
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "grid");
return SET_PROPERTY_ERROR;
if (piGridColor == NULL)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"grid");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "grid");
return SET_PROPERTY_ERROR;
}
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"grid");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "grid");
return SET_PROPERTY_ERROR;
}
/*------------------------------------------------------------------------*/
int set_hidden_axis_color_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- BOOL status = FALSE;
- int haColor = 0;
-
- if ( !isParameterDoubleMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "hidden_axis_color");
- return SET_PROPERTY_ERROR ;
- }
-
- haColor = (int) getDoubleFromStack( stackPointer );
-
- status = setGraphicObjectProperty(pobjUID, __GO_HIDDEN_AXIS_COLOR__, &haColor, jni_int, 1);
-
- if (status == TRUE)
- {
- return SET_PROPERTY_SUCCEED;
- }
- else
- {
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"hidden_axis_color");
- return SET_PROPERTY_ERROR;
- }
+ BOOL status = FALSE;
+ int haColor = 0;
+
+ if ( !( valueType == sci_matrix ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "hidden_axis_color");
+ return SET_PROPERTY_ERROR ;
+ }
+
+ haColor = (int) getDoubleFromStack( stackPointer );
+
+ status = setGraphicObjectProperty(pobjUID, __GO_HIDDEN_AXIS_COLOR__, &haColor, jni_int, 1);
+
+ if (status == TRUE)
+ {
+ return SET_PROPERTY_SUCCEED;
+ }
+ else
+ {
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "hidden_axis_color");
+ return SET_PROPERTY_ERROR;
+ }
}
/*------------------------------------------------------------------------*/
BOOL status = FALSE;
int hiddenColor = 0;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "hidden_color");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"hidden_color");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "hidden_color");
return SET_PROPERTY_ERROR;
}
}
/*------------------------------------------------------------------------*/
int set_info_message_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- BOOL status = FALSE;
- if ( !isParameterStringMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "info_message");
- return SET_PROPERTY_ERROR ;
- }
+ BOOL status = FALSE;
+ if ( !( valueType == sci_strings ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "info_message");
+ return SET_PROPERTY_ERROR ;
+ }
- status = setGraphicObjectProperty(pobjUID, __GO_INFO_MESSAGE__, getStringFromStack( stackPointer ), jni_string, 1);
+ status = setGraphicObjectProperty(pobjUID, __GO_INFO_MESSAGE__, getStringFromStack( stackPointer ), jni_string, 1);
- if (status == TRUE)
- {
- return SET_PROPERTY_SUCCEED;
- }
- else
- {
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"info_message");
- return SET_PROPERTY_ERROR;
- }
+ if (status == TRUE)
+ {
+ return SET_PROPERTY_SUCCEED;
+ }
+ else
+ {
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "info_message");
+ return SET_PROPERTY_ERROR;
+ }
}
/*------------------------------------------------------------------------*/
int iNumElements = 0;
int* piNumElements = &iNumElements;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "interp_color_vector");
return SET_PROPERTY_ERROR;
*/
if (piNumElements == NULL)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"data");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "data");
return SET_PROPERTY_ERROR;
}
- if( ( nbCol == 3 && iNumElements == 3 ) ||
- ( nbCol == 4 && iNumElements == 4 ) )
+ if ( ( nbCol == 3 && iNumElements == 3 ) ||
+ ( nbCol == 4 && iNumElements == 4 ) )
{
int tmp[4];
- getDoubleMatrixFromStack( stackPointer );
+ stk( stackPointer );
copyDoubleVectorToIntFromStack( stackPointer, tmp, nbCol );
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"interp_color_vector");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "interp_color_vector");
return SET_PROPERTY_ERROR;
}
}
else
{
- Scierror(999, _("The number of column of the color vector must match the number of points defining the line (which must be %d or %d).\n"),3,4);
+ Scierror(999, _("The number of column of the color vector must match the number of points defining the line (which must be %d or %d).\n"), 3, 4);
return SET_PROPERTY_ERROR;
}
}
/*------------------------------------------------------------------------*/
int set_labels_font_style_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- BOOL status = FALSE;
- int fontStyle = 0;
+ BOOL status = FALSE;
+ int fontStyle = 0;
- if ( !isParameterDoubleMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "labels_font_style");
- return SET_PROPERTY_ERROR ;
- }
+ if ( !( valueType == sci_matrix ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "labels_font_style");
+ return SET_PROPERTY_ERROR ;
+ }
fontStyle = (int) getDoubleFromStack(stackPointer);
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"labels_font_style");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "labels_font_style");
return SET_PROPERTY_ERROR;
}
BOOL status = FALSE;
int fontColor = 0;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "labels_font_color");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"labels_font_color");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "labels_font_color");
return SET_PROPERTY_ERROR;
}
}
BOOL status = FALSE;
double fontSize = 0.;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real expected.\n"), "labels_font_size");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"labels_font_size");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "labels_font_size");
return SET_PROPERTY_ERROR;
}
}
{
BOOL status = FALSE;
char* legendLocationsNames[11] = {"in_upper_right", "in_upper_left", "in_lower_right", "in_lower_left",
- "out_upper_right", "out_upper_left", "out_lower_right", "out_lower_left", "upper_caption", "lower_caption",
- "by_coordinates"};
+ "out_upper_right", "out_upper_left", "out_lower_right", "out_lower_left", "upper_caption", "lower_caption",
+ "by_coordinates"
+ };
int i = 0;
int index = -1;
char* legendLocation = NULL;
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "legend_location");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"legend_location");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "legend_location");
return SET_PROPERTY_ERROR;
}
{
int iLineStyle = 1;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "line_style");
return SET_PROPERTY_ERROR;
#include "localization.h"
#include "HandleManagement.h"
#include "MALLOC.h"
+#include "sci_types.h"
#include "getGraphicObjectProperty.h"
#include "setGraphicObjectProperty.h"
int iLinksCount = 0;
int* piLinksCount = &iLinksCount;
- if ( !isParameterHandle( valueType ) )
+ if ( !( valueType == sci_handles ) )
{
Scierror(999, _("Wrong type for '%s' property: Graphic handle array expected.\n"), "links");
return SET_PROPERTY_ERROR;
int cmpteur = 0, cmpteur2 = 0, offset = 0;
- for(i=0;i<nbtics;i++)
- {
- if(u_xgrads[i]<=0){
- sciprint("Warning: graduation number %d is ignored : when switching to logarithmic scale, we must have strictly positive graduations!\n",i);
- }
- else
+ for (i = 0; i < nbtics; i++)
{
- u_xgrads[cmpteur] = log10(u_xgrads[i]);
- cmpteur++;
+ if (u_xgrads[i] <= 0)
+ {
+ sciprint("Warning: graduation number %d is ignored : when switching to logarithmic scale, we must have strictly positive graduations!\n", i);
+ }
+ else
+ {
+ u_xgrads[cmpteur] = log10(u_xgrads[i]);
+ cmpteur++;
+ }
}
- }
- if(cmpteur != nbtics)
+ if (cmpteur != nbtics)
{
- if((ticklabel=(char **)MALLOC(cmpteur*sizeof(char *)))==NULL){
- Scierror(999, _("%s: No more memory.\n"),"CaseLogflagN");
- return NULL;
+ if ((ticklabel = (char **)MALLOC(cmpteur * sizeof(char *))) == NULL)
+ {
+ Scierror(999, _("%s: No more memory.\n"), "CaseLogflagN");
+ return NULL;
}
cmpteur2 = 0;
offset = nbtics - cmpteur;
- for(i=0;i<cmpteur;i++){
- if((ticklabel[cmpteur2]=(char *)MALLOC((strlen(u_xlabels[i+offset])+1)*sizeof(char )))==NULL){
- Scierror(999, _("%s: No more memory.\n"),"CaseLogflagN");
+ for (i = 0; i < cmpteur; i++)
+ {
+ if ((ticklabel[cmpteur2] = (char *)MALLOC((strlen(u_xlabels[i + offset]) + 1) * sizeof(char ))) == NULL)
+ {
+ Scierror(999, _("%s: No more memory.\n"), "CaseLogflagN");
}
- strcpy(ticklabel[cmpteur2],u_xlabels[i+offset]);
+ strcpy(ticklabel[cmpteur2], u_xlabels[i + offset]);
cmpteur2++;
}
char ** ReBuildUserTicks( char old_logflag, char new_logflag, double * u_xgrads, int *u_nxgrads, char ** u_xlabels)
{
- if(old_logflag==new_logflag) { return u_xlabels; } /* nothing to do l->l or n->n */
+ if (old_logflag == new_logflag)
+ {
+ return u_xlabels; /* nothing to do l->l or n->n */
+ }
- if(u_xgrads!=NULL)
+ if (u_xgrads != NULL)
{
- if(old_logflag=='n' && new_logflag=='l') /* n->l */ /* 10-> 1, 100->2 ...*/
+ if (old_logflag == 'n' && new_logflag == 'l') /* n->l */ /* 10-> 1, 100->2 ...*/
{
- u_xlabels=CaseLogflagN2L(u_nxgrads,u_xgrads,u_xlabels);
+ u_xlabels = CaseLogflagN2L(u_nxgrads, u_xgrads, u_xlabels);
}
- else if(old_logflag=='l' && new_logflag=='n')
+ else if (old_logflag == 'l' && new_logflag == 'n')
{
int nbtics = *u_nxgrads;
int i;
- for(i=0;i<nbtics;i++) u_xgrads[i] = exp10(u_xgrads[i]);
+ for (i = 0; i < nbtics; i++) u_xgrads[i] = exp10(u_xgrads[i]);
}
}
int i = 0;
double* dataBounds = NULL;
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "log_flags");
return SET_PROPERTY_ERROR ;
/* flags must be 'n' or 'l' */
if ( (flags[0] != 'n' && flags[0] != 'l')
- || (flags[1] != 'n' && flags[1] != 'l'))
+ || (flags[1] != 'n' && flags[1] != 'l'))
{
- Scierror(999, _("%s: Wrong value for argument: '%s' or '%s' expected.\n"),"flags","n","l");
+ Scierror(999, _("%s: Wrong value for argument: '%s' or '%s' expected.\n"), "flags", "n", "l");
return SET_PROPERTY_ERROR ;
}
if (piLogFlag == NULL)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"log_flags");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "log_flags");
return SET_PROPERTY_ERROR;
}
if (dataBounds == NULL)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"data_bounds");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "data_bounds");
return SET_PROPERTY_ERROR;
}
/* X axes */
- if( ( dataBounds[0] <= 0. || dataBounds[1] <= 0.) && flags[0] == 'l' )
+ if ( ( dataBounds[0] <= 0. || dataBounds[1] <= 0.) && flags[0] == 'l' )
{
- Scierror(999, _("Error: data_bounds on %s axis must be strictly positive to switch to logarithmic mode.\n"),"x");
+ Scierror(999, _("Error: data_bounds on %s axis must be strictly positive to switch to logarithmic mode.\n"), "x");
return SET_PROPERTY_ERROR ;
}
*/
#if 0
ppSubWin->axes.u_xlabels = ReBuildUserTicks( curLogFlags[0], flags[0],
- ppSubWin->axes.u_xgrads,
- &ppSubWin->axes.u_nxgrads,
- ppSubWin->axes.u_xlabels );
+ ppSubWin->axes.u_xgrads,
+ &ppSubWin->axes.u_nxgrads,
+ ppSubWin->axes.u_xlabels );
#endif
curLogFlags[0] = flags[0];
/* Y axes */
- if( ( dataBounds[2] <= 0. || dataBounds[3] <= 0. ) && flags[1] == 'l' )
+ if ( ( dataBounds[2] <= 0. || dataBounds[3] <= 0. ) && flags[1] == 'l' )
{
- Scierror(999, _("Error: data_bounds on %s axis must be strictly positive to switch to logarithmic mode.\n"),"y");
+ Scierror(999, _("Error: data_bounds on %s axis must be strictly positive to switch to logarithmic mode.\n"), "y");
return SET_PROPERTY_ERROR;
}
*/
#if 0
ppSubWin->axes.u_ylabels = ReBuildUserTicks( curLogFlags[1], flags[1],
- ppSubWin->axes.u_ygrads,
- &ppSubWin->axes.u_nygrads,
- ppSubWin->axes.u_ylabels );
+ ppSubWin->axes.u_ygrads,
+ &ppSubWin->axes.u_nygrads,
+ ppSubWin->axes.u_ylabels );
#endif
curLogFlags[1] = flags[1];
if ( ( dataBounds[4] <= 0. || dataBounds[5] <= 0. ) && flags[2] == 'l' )
{
- Scierror(999, _("Error: data_bounds on %s axis must be strictly positive to switch to logarithmic mode.\n"),"z");
+ Scierror(999, _("Error: data_bounds on %s axis must be strictly positive to switch to logarithmic mode.\n"), "z");
return SET_PROPERTY_ERROR;
}
*/
#if 0
ppSubWin->axes.u_zlabels = ReBuildUserTicks( curLogFlags[2], flags[2],
- ppSubWin->axes.u_zgrads,
- &ppSubWin->axes.u_nzgrads,
- ppSubWin->axes.u_zlabels);
+ ppSubWin->axes.u_zgrads,
+ &ppSubWin->axes.u_nzgrads,
+ ppSubWin->axes.u_zlabels);
#endif
curLogFlags[2] = flags[2];
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"log_flags");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "log_flags");
return SET_PROPERTY_ERROR;
}
}
/*------------------------------------------------------------------------*/
int set_margins_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- BOOL status = FALSE;
- double margins[4];
+ BOOL status = FALSE;
+ double margins[4];
- if ( !isParameterDoubleMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "margins");
- return SET_PROPERTY_ERROR ;
- }
+ if ( !( valueType == sci_matrix ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "margins");
+ return SET_PROPERTY_ERROR ;
+ }
- if ( nbRow * nbCol != 4 )
- {
- Scierror(999, _("Wrong size for '%s' property: %d elements expected.\n"), "margins", 4);
- return SET_PROPERTY_ERROR ;
- }
+ if ( nbRow * nbCol != 4 )
+ {
+ Scierror(999, _("Wrong size for '%s' property: %d elements expected.\n"), "margins", 4);
+ return SET_PROPERTY_ERROR ;
+ }
- copyDoubleVectorFromStack( stackPointer, margins, 4 );
+ copyDoubleVectorFromStack( stackPointer, margins, 4 );
- status = setGraphicObjectProperty(pobjUID, __GO_MARGINS__, margins, jni_double_vector, 4);
+ status = setGraphicObjectProperty(pobjUID, __GO_MARGINS__, margins, jni_double_vector, 4);
- if (status == TRUE)
- {
- return SET_PROPERTY_SUCCEED;
- }
- else
- {
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"margins") ;
- return SET_PROPERTY_ERROR;
- }
+ if (status == TRUE)
+ {
+ return SET_PROPERTY_SUCCEED;
+ }
+ else
+ {
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "margins") ;
+ return SET_PROPERTY_ERROR;
+ }
}
/*------------------------------------------------------------------------*/
BOOL status = FALSE;
int markBackground = 0;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "mark_background");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"mark_background");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "mark_background");
return SET_PROPERTY_ERROR;
}
}
BOOL status = FALSE;
int markForeground = 0;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "mark_foreground");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"mark_foreground");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "mark_foreground");
return SET_PROPERTY_ERROR;
}
}
/*------------------------------------------------------------------------*/
int set_mark_size_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- if ( !isParameterDoubleMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: Real expected.\n"), "mark_size");
- return SET_PROPERTY_ERROR ;
- }
+ if ( !( valueType == sci_matrix ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: Real expected.\n"), "mark_size");
+ return SET_PROPERTY_ERROR ;
+ }
- return sciSetMarkSize( pobjUID, (int) getDoubleFromStack( stackPointer ) ) ;
+ return sciSetMarkSize( pobjUID, (int) getDoubleFromStack( stackPointer ) ) ;
}
/*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*/
int set_mark_size_unit_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- BOOL status = FALSE;
- int markSizeUnit = 0;
+ BOOL status = FALSE;
+ int markSizeUnit = 0;
- if ( !isParameterStringMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "mark_size_unit");
- return SET_PROPERTY_ERROR ;
- }
+ if ( !( valueType == sci_strings ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "mark_size_unit");
+ return SET_PROPERTY_ERROR ;
+ }
- /* 0 : point, 1 : tabulated */
- if ( isStringParamEqual( stackPointer, "point") )
- {
- markSizeUnit = 0;
- }
- else if ( isStringParamEqual( stackPointer, "tabulated" ) )
- {
- markSizeUnit = 1;
- }
- else
- {
- Scierror(999, _("Wrong value for '%s' property: %s or %s expected.\n"), "mark_size_unit", "'point'", "'tabulated'");
+ /* 0 : point, 1 : tabulated */
+ if ( isStringParamEqual( stackPointer, "point") )
+ {
+ markSizeUnit = 0;
+ }
+ else if ( isStringParamEqual( stackPointer, "tabulated" ) )
+ {
+ markSizeUnit = 1;
+ }
+ else
+ {
+ Scierror(999, _("Wrong value for '%s' property: %s or %s expected.\n"), "mark_size_unit", "'point'", "'tabulated'");
- }
+ }
- status = setGraphicObjectProperty(pobjUID, __GO_MARK_SIZE_UNIT__, &markSizeUnit, jni_int, 1);
+ status = setGraphicObjectProperty(pobjUID, __GO_MARK_SIZE_UNIT__, &markSizeUnit, jni_int, 1);
- if (status == TRUE)
- {
- return SET_PROPERTY_SUCCEED;
- }
- else
- {
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"mark_size_unit");
- return SET_PROPERTY_ERROR;
- }
+ if (status == TRUE)
+ {
+ return SET_PROPERTY_SUCCEED;
+ }
+ else
+ {
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "mark_size_unit");
+ return SET_PROPERTY_ERROR;
+ }
}
/*------------------------------------------------------------------------*/
int markMode = 1;
int markStyle = 0;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "mark_style");
return SET_PROPERTY_ERROR ;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"mark_mode");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "mark_mode");
status1 = SET_PROPERTY_ERROR;
}
int values[2];
int nbColors = 0;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "outside_colors");
return SET_PROPERTY_ERROR;
nbColors = sciGetNumColors(pobjUID);
if ( values[0] > nbColors || values[0] < -1
- || values[1] > nbColors || values[1] < -1)
+ || values[1] > nbColors || values[1] < -1)
{
/* It is possible to set color_range outside the colormap, however it won't be used.*/
sciprint(_("WARNING: Wrong value for '%s' property: indices outside the colormap will be clamped.\n"), "outside_colors");
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"outside_colors");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "outside_colors");
return SET_PROPERTY_ERROR;
}
#include "localization.h"
#include "pixel_mode.h"
#include "SetPropertyStatus.h"
+#include "sci_types.h"
#include "setGraphicObjectProperty.h"
#include "graphicObjectProperties.h"
/*------------------------------------------------------------------------*/
int set_pixel_drawing_mode_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- int v = -1;
- BOOL status = FALSE;
+ int v = -1;
+ BOOL status = FALSE;
- if ( !isParameterStringMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "pixel_drawing_mode");
- return SET_PROPERTY_ERROR ;
- }
+ if ( !( valueType == sci_strings ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "pixel_drawing_mode");
+ return SET_PROPERTY_ERROR ;
+ }
- v = getPixelModeIndex( getStringFromStack( stackPointer ) ) ;
+ v = getPixelModeIndex( getStringFromStack( stackPointer ) ) ;
- if ( v < 0 )
- {
- Scierror(999, _("Wrong value for '%s' property: Must be in the set {%s}.\n"), "pixel_drawing_mode", "and, andReverse, andInverted, clear, copy, copyInverted, equiv, invert, noop, nor, nand, or, orReverse, orInverted, set, xor");
- return SET_PROPERTY_ERROR ;
- }
+ if ( v < 0 )
+ {
+ Scierror(999, _("Wrong value for '%s' property: Must be in the set {%s}.\n"), "pixel_drawing_mode", "and, andReverse, andInverted, clear, copy, copyInverted, equiv, invert, noop, nor, nand, or, orReverse, orInverted, set, xor");
+ return SET_PROPERTY_ERROR ;
+ }
- status = setGraphicObjectProperty(pobjUID, __GO_PIXEL_DRAWING_MODE__, &v, jni_int, 1);
+ status = setGraphicObjectProperty(pobjUID, __GO_PIXEL_DRAWING_MODE__, &v, jni_int, 1);
- if (status == TRUE)
- {
- return SET_PROPERTY_SUCCEED;
- }
- else
- {
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"pixel_drawing_mode");
- return SET_PROPERTY_ERROR;
- }
+ if (status == TRUE)
+ {
+ return SET_PROPERTY_SUCCEED;
+ }
+ else
+ {
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "pixel_drawing_mode");
+ return SET_PROPERTY_ERROR;
+ }
}
/*------------------------------------------------------------------------*/
BOOL status = FALSE;
int value = 0;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "polyline_style");
return SET_PROPERTY_ERROR;
value = (int) getDoubleFromStack( stackPointer );
if ( value < 1 || value > 7 )
{
- Scierror(999, _("Wrong value for '%s' property: Must be between %d and %d.\n"),"polyline_style",1,7);
+ Scierror(999, _("Wrong value for '%s' property: Must be between %d and %d.\n"), "polyline_style", 1, 7);
return SET_PROPERTY_ERROR;
}
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"polyline_style");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "polyline_style");
return SET_PROPERTY_ERROR;
}
for respectively the Label and Legend */
if (strcmp(type, __GO_LABEL__) == 0)
{
- double* values = getDoubleMatrixFromStack( stackPointer );
+ double* values = stk( stackPointer );
double* currentPosition;
double labelPosition[3];
}
else if (strcmp(type, __GO_LEGEND__) == 0)
{
- double * values = getDoubleMatrixFromStack( stackPointer );
+ double * values = stk( stackPointer );
status = setGraphicObjectProperty(pobjUID, __GO_POSITION__, values, jni_double_vector, 2);
int set_rotation_angles_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
BOOL status = FALSE;
- double * values = getDoubleMatrixFromStack( stackPointer ) ;
+ double * values = stk( stackPointer ) ;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "rotation_angles");
return SET_PROPERTY_ERROR ;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"rotation_angles") ;
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "rotation_angles") ;
return SET_PROPERTY_ERROR;
}
}
getStringFromStack(stackPointer);
- if (!isParameterStringMatrix(valueType))
+ if (!( valueType == sci_strings ))
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "rotation_style");
return SET_PROPERTY_ERROR;
/*------------------------------------------------------------------------*/
int set_screen_position_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- double * values = NULL;
- BOOL status = FALSE;
- int intValues[2];
+ double * values = NULL;
+ BOOL status = FALSE;
+ int intValues[2];
- if ( !isParameterDoubleMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "screen_position");
- return SET_PROPERTY_ERROR ;
- }
+ if ( !( valueType == sci_matrix ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "screen_position");
+ return SET_PROPERTY_ERROR ;
+ }
- values = getDoubleMatrixFromStack( stackPointer ) ;
+ values = stk( stackPointer ) ;
- if ( nbRow * nbCol != 2 )
- {
- Scierror(999, _("Wrong size for '%s' property: %d elements expected.\n"), "screen_position", 2);
- return SET_PROPERTY_ERROR ;
- }
+ if ( nbRow * nbCol != 2 )
+ {
+ Scierror(999, _("Wrong size for '%s' property: %d elements expected.\n"), "screen_position", 2);
+ return SET_PROPERTY_ERROR ;
+ }
- intValues[0] = (int)values[0];
- intValues[1] = (int)values[1];
+ intValues[0] = (int)values[0];
+ intValues[1] = (int)values[1];
- status = setGraphicObjectProperty(pobjUID, __GO_POSITION__, intValues, jni_int_vector, 2);
+ status = setGraphicObjectProperty(pobjUID, __GO_POSITION__, intValues, jni_int_vector, 2);
- if(status == TRUE)
- {
- return SET_PROPERTY_SUCCEED;
- }
- else
- {
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"screen_position");
- return SET_PROPERTY_ERROR;
- }
+ if (status == TRUE)
+ {
+ return SET_PROPERTY_SUCCEED;
+ }
+ else
+ {
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "screen_position");
+ return SET_PROPERTY_ERROR;
+ }
}
/*------------------------------------------------------------------------*/
int* piNbSegs = &iNbSegs;
int* segsColors = NULL;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "segs_color");
return SET_PROPERTY_ERROR;
if (piNbSegs == NULL)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"segs_color");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "segs_color");
return SET_PROPERTY_ERROR;
}
}
else if ( nbRow * nbCol == iNbSegs )
{
- segsColors = (int*) MALLOC(iNbSegs*sizeof(int));
+ segsColors = (int*) MALLOC(iNbSegs * sizeof(int));
if (segsColors == NULL)
{
- Scierror(999, _("%s: No more memory.\n"),"set_segs_colors_property");
+ Scierror(999, _("%s: No more memory.\n"), "set_segs_colors_property");
return SET_PROPERTY_ERROR;
}
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"segs_colors");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "segs_colors");
return SET_PROPERTY_ERROR;
}
char* type = NULL;
char* axisSubticksPropertiesNames[3] = {__GO_X_AXIS_SUBTICKS__, __GO_Y_AXIS_SUBTICKS__, __GO_Z_AXIS_SUBTICKS__};
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "sub_tics");
return SET_PROPERTY_ERROR ;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"sub_tics");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "sub_tics");
return SET_PROPERTY_ERROR;
}
}
{
int autoSubticks;
int i;
- double * values = getDoubleMatrixFromStack( stackPointer );
+ double * values = stk( stackPointer );
result = SET_PROPERTY_SUCCEED;
if (status == FALSE)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"sub_ticks");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "sub_ticks");
return SET_PROPERTY_ERROR;
}
nbTicks = (int) values[i];
- if( nbTicks < 0 )
+ if ( nbTicks < 0 )
{
nbTicks = 0;
}
if (result == SET_PROPERTY_ERROR)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"sub_ticks");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "sub_ticks");
}
return result;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"sub_ticks");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "sub_ticks");
return SET_PROPERTY_ERROR;
}
return SET_PROPERTY_SUCCEED;
int status1 = 0;
int status2 = 0;
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "text_box_mode");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"text_box_mode");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "text_box_mode");
status1 = SET_PROPERTY_ERROR;
}
int set_text_box_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
BOOL status = FALSE;
- double * values = getDoubleMatrixFromStack( stackPointer );
+ double * values = stk( stackPointer );
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "text_box");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"text_box");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "text_box");
return SET_PROPERTY_ERROR;
}
}
/*------------------------------------------------------------------------*/
int set_text_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String matrix expected.\n"), "text");
return SET_PROPERTY_ERROR;
int set_thickness_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real expected.\n"), "thickness");
return SET_PROPERTY_ERROR;
BOOL status = FALSE;
int ticksColor = 0;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Integer expected.\n"), "tics_color");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"tics_color");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "tics_color");
return SET_PROPERTY_ERROR;
}
int yNumberTicks = 0;
int *piYNumberTicks = &yNumberTicks;
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "tics_direction");
return SET_PROPERTY_ERROR;
if (piYNumberTicks == NULL)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"tics_direction");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "tics_direction");
return SET_PROPERTY_ERROR;
}
if (yNumberTicks == 1)
{
- if( isStringParamEqual( stackPointer, "top" ) )
+ if ( isStringParamEqual( stackPointer, "top" ) )
{
ticksDirection = 0;
}
}
else
{
- if( isStringParamEqual( stackPointer, "left" ) )
+ if ( isStringParamEqual( stackPointer, "left" ) )
{
ticksDirection = 2;
}
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"tics_direction");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "tics_direction");
return SET_PROPERTY_ERROR;
}
}
int* piNbTicksLabels = &iNbTicksLabels;
char** stringVector = NULL;
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String matrix expected.\n"), "tics_labels");
return SET_PROPERTY_ERROR;
if (piNbTicksLabels == NULL)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"tics_labels");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "tics_labels");
return SET_PROPERTY_ERROR;
}
- if ( iNbTicksLabels > nbRow*nbCol )
+ if ( iNbTicksLabels > nbRow * nbCol )
{
Scierror(999, _("Wrong size for '%s' property: At least %d elements expected.\n"), "tics_labels", iNbTicksLabels);
return SET_PROPERTY_ERROR;
}
- stringVector = createCopyStringMatrixFromStack( stackPointer, nbRow*nbCol );
+ stringVector = createCopyStringMatrixFromStack( stackPointer, nbRow * nbCol );
/* Check if we should load LaTex / MathML Java libraries */
- loadTextRenderingAPI(stringVector, nbRow*nbCol, 1);
+ loadTextRenderingAPI(stringVector, nbRow * nbCol, 1);
- status = setGraphicObjectProperty(pobjUID, __GO_TICKS_LABELS__, stringVector, jni_string_vector, nbRow*nbCol);
+ status = setGraphicObjectProperty(pobjUID, __GO_TICKS_LABELS__, stringVector, jni_string_vector, nbRow * nbCol);
- destroyStringArray(stringVector, nbRow*nbCol);
+ destroyStringArray(stringVector, nbRow * nbCol);
if (status == TRUE)
{
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"tics_labels");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "tics_labels");
return SET_PROPERTY_ERROR;
}
}
char xy_type = 0;
- if ( !isParameterStringMatrix( valueType ) )
+ if ( !( valueType == sci_strings ) )
{
Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "tics_style");
return SET_PROPERTY_ERROR;
}
if ( !isStringParamEqual( stackPointer, "v" )
- && !isStringParamEqual( stackPointer, "r" )
- && !isStringParamEqual( stackPointer, "i" ) )
+ && !isStringParamEqual( stackPointer, "r" )
+ && !isStringParamEqual( stackPointer, "i" ) )
{
Scierror(999, _("Wrong value for '%s' property: Must be in the set {%s}.\n"), "tics_style", "v, r, i");
return SET_PROPERTY_ERROR;
}
- /* get the character 'v', 'r' or 'i' */
+ /* get the character 'v', 'r' or 'i' */
xy_type = getStringFromStack( stackPointer )[0];
if (xy_type == 'v')
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"tics_style");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "tics_style");
return SET_PROPERTY_ERROR;
}
}
BOOL result = FALSE;
double* pnoeud = NULL;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "triangles");
return SET_PROPERTY_ERROR;
if (strcmp(type, __GO_FEC__) != 0)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"triangles");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "triangles");
return SET_PROPERTY_ERROR;
}
if (result == FALSE)
{
- Scierror(999, _("%s: No more memory.\n"),"set_triangles_property");
+ Scierror(999, _("%s: No more memory.\n"), "set_triangles_property");
return SET_PROPERTY_ERROR;
}
- pnoeud = getDoubleMatrixFromStack(stackPointer);
+ pnoeud = stk(stackPointer);
setGraphicObjectProperty(pobjUID, __GO_DATA_MODEL_FEC_TRIANGLES__, pnoeud, jni_double_vector, nbRow);
/*------------------------------------------------------------------------*/
int set_view_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- BOOL status = FALSE;
- int viewType = 0;
+ BOOL status = FALSE;
+ int viewType = 0;
- if ( !isParameterStringMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "view");
- return SET_PROPERTY_ERROR ;
- }
+ if ( !( valueType == sci_strings ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "view");
+ return SET_PROPERTY_ERROR ;
+ }
- if ( isStringParamEqual( stackPointer, "2d" ) )
- {
- viewType = 0;
- }
- else if ( isStringParamEqual( stackPointer, "3d" ) )
- {
- viewType = 1;
- }
- else
- {
- Scierror(999, _("Wrong value for '%s' property: %s or %s expected.\n"), "view", "'2d'", "'3d'");
+ if ( isStringParamEqual( stackPointer, "2d" ) )
+ {
+ viewType = 0;
+ }
+ else if ( isStringParamEqual( stackPointer, "3d" ) )
+ {
+ viewType = 1;
+ }
+ else
+ {
+ Scierror(999, _("Wrong value for '%s' property: %s or %s expected.\n"), "view", "'2d'", "'3d'");
- }
+ }
- status = setGraphicObjectProperty(pobjUID, __GO_VIEW__, &viewType, jni_int, 1);
+ status = setGraphicObjectProperty(pobjUID, __GO_VIEW__, &viewType, jni_int, 1);
- if (status = TRUE)
- {
- return SET_PROPERTY_SUCCEED;
- }
- else
- {
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"view");
- return SET_PROPERTY_ERROR ;
- }
+ if (status = TRUE)
+ {
+ return SET_PROPERTY_SUCCEED;
+ }
+ else
+ {
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "view");
+ return SET_PROPERTY_ERROR ;
+ }
}
/*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*/
int set_viewport_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- int values[4];
- BOOL status = FALSE;
+ int values[4];
+ BOOL status = FALSE;
- if ( !isParameterDoubleMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "viewport");
- return SET_PROPERTY_ERROR ;
- }
+ if ( !( valueType == sci_matrix ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "viewport");
+ return SET_PROPERTY_ERROR ;
+ }
- if ( nbRow * nbCol != 2 )
- {
- Scierror(999, _("Wrong size for '%s' property: %d elements expected.\n"), "viewport", 2);
- return SET_PROPERTY_ERROR ;
- }
+ if ( nbRow * nbCol != 2 )
+ {
+ Scierror(999, _("Wrong size for '%s' property: %d elements expected.\n"), "viewport", 2);
+ return SET_PROPERTY_ERROR ;
+ }
- /* For now we just use viewport positions */
- copyDoubleVectorToIntFromStack(stackPointer, values, 2);
+ /* For now we just use viewport positions */
+ copyDoubleVectorToIntFromStack(stackPointer, values, 2);
- /* dummy values */
- values[2] = 0;
- values[3] = 0;
+ /* dummy values */
+ values[2] = 0;
+ values[3] = 0;
- status = setGraphicObjectProperty(pobjUID, __GO_VIEWPORT__, values, jni_int_vector, 2);
+ status = setGraphicObjectProperty(pobjUID, __GO_VIEWPORT__, values, jni_int_vector, 2);
- if (status == TRUE)
- {
- return SET_PROPERTY_SUCCEED;
- }
- else
- {
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"viewport");
- return SET_PROPERTY_ERROR;
- }
+ if (status == TRUE)
+ {
+ return SET_PROPERTY_SUCCEED;
+ }
+ else
+ {
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "viewport");
+ return SET_PROPERTY_ERROR;
+ }
}
/*------------------------------------------------------------------------*/
/*------------------------------------------------------------------------*/
int set_x_location_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- BOOL status = FALSE;
- int axisLocation = 0;
+ BOOL status = FALSE;
+ int axisLocation = 0;
- if ( !isParameterStringMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "x_location");
- return SET_PROPERTY_ERROR;
- }
+ if ( !( valueType == sci_strings ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "x_location");
+ return SET_PROPERTY_ERROR;
+ }
- if ( isStringParamEqual( stackPointer, "bottom" ) )
- {
- axisLocation = 0;
- }
- else if ( isStringParamEqual( stackPointer, "top" ) )
- {
- axisLocation = 1;
- }
- else if ( isStringParamEqual( stackPointer, "middle" ) )
- {
- axisLocation = 2;
- }
- else if ( isStringParamEqual( stackPointer, "origin" ) )
- {
- axisLocation = 3;
- }
- else
- {
- Scierror(999, _("Wrong value for '%s' property: Must be in the set {%s}.\n"), "x_location", "bottom, top, middle, origin");
- return SET_PROPERTY_ERROR ;
- }
+ if ( isStringParamEqual( stackPointer, "bottom" ) )
+ {
+ axisLocation = 0;
+ }
+ else if ( isStringParamEqual( stackPointer, "top" ) )
+ {
+ axisLocation = 1;
+ }
+ else if ( isStringParamEqual( stackPointer, "middle" ) )
+ {
+ axisLocation = 2;
+ }
+ else if ( isStringParamEqual( stackPointer, "origin" ) )
+ {
+ axisLocation = 3;
+ }
+ else
+ {
+ Scierror(999, _("Wrong value for '%s' property: Must be in the set {%s}.\n"), "x_location", "bottom, top, middle, origin");
+ return SET_PROPERTY_ERROR ;
+ }
- status = setGraphicObjectProperty(pobjUID, __GO_X_AXIS_LOCATION__, &axisLocation, jni_int, 1);
+ status = setGraphicObjectProperty(pobjUID, __GO_X_AXIS_LOCATION__, &axisLocation, jni_int, 1);
- if (status == TRUE)
- {
- return SET_PROPERTY_SUCCEED ;
- }
- else
- {
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"x_location");
- return SET_PROPERTY_ERROR;
- }
+ if (status == TRUE)
+ {
+ return SET_PROPERTY_SUCCEED ;
+ }
+ else
+ {
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "x_location");
+ return SET_PROPERTY_ERROR;
+ }
}
/*------------------------------------------------------------------------*/
int iNumElements = 0;
int* piNumElements = &iNumElements;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "x_shift");
return SET_PROPERTY_ERROR;
if (piNumElements == NULL)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"x_shift");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "x_shift");
return SET_PROPERTY_ERROR;
}
return SET_PROPERTY_ERROR;
}
- if( nbElement != 0 )
+ if ( nbElement != 0 )
{
- shiftCoordinates = (double*) getDoubleMatrixFromStack(stackPointer);
+ shiftCoordinates = (double*) stk(stackPointer);
result = setGraphicObjectProperty(pobjUID, __GO_DATA_MODEL_X_COORDINATES_SHIFT__, shiftCoordinates, jni_double_vector, iNumElements);
/* The FALSE value is used for now to identify a failed memory allocation */
if (result == FALSE)
{
- Scierror(999, _("%s: No more memory.\n"),"set_x_shift_property");
+ Scierror(999, _("%s: No more memory.\n"), "set_x_shift_property");
return SET_PROPERTY_ERROR;
}
}
#include "DrawObjects.h"
#include "freeArrayOfString.h"
#include "loadTextRenderingAPI.h"
+#include "sci_types.h"
#include "setGraphicObjectProperty.h"
#include "graphicObjectProperties.h"
double* userGrads = NULL;
char** userLabels = NULL;
- if ( !isParameterTlist( valueType ) )
+ if ( !(valueType == sci_tlist ))
{
Scierror(999, _("Wrong type for '%s' property: Typed list expected.\n"), "x_ticks");
return SET_PROPERTY_ERROR ;
if ( userGrads == NULL && nbTicsRow == -1 )
{
- Scierror(999, _("%s: No more memory.\n"),"set_x_ticks_property");
+ Scierror(999, _("%s: No more memory.\n"), "set_x_ticks_property");
return SET_PROPERTY_ERROR ;
}
setGraphicObjectProperty(pobjUID, __GO_X_AXIS_AUTO_TICKS__, &autoTicks, jni_bool, 1);
- status = setGraphicObjectProperty(pobjUID, __GO_X_AXIS_TICKS_LOCATIONS__, userGrads, jni_double_vector, nbTicsRow*nbTicsCol);
+ status = setGraphicObjectProperty(pobjUID, __GO_X_AXIS_TICKS_LOCATIONS__, userGrads, jni_double_vector, nbTicsRow * nbTicsCol);
if (status == FALSE)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"x_ticks");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "x_ticks");
FREE(userGrads);
return SET_PROPERTY_ERROR;
}
// We need to check the size to not be 0 because an empty matrix is a matrix of double
// and 'getCurrentStringMatrixFromList' expect a matrix of string (see bug 5148).
// P.Lando
- if( nbTicsCol * nbTicsRow )
+ if ( nbTicsCol * nbTicsRow )
{
userLabels = getCurrentStringMatrixFromList( tlist, &nbTicsRow, &nbTicsCol );
/* Check if we should load LaTex / MathML Java libraries */
loadTextRenderingAPI(userLabels, nbTicsCol, nbTicsRow);
- setGraphicObjectProperty(pobjUID, __GO_X_AXIS_TICKS_LABELS__, userLabels, jni_string_vector, nbTicsRow*nbTicsCol);
+ setGraphicObjectProperty(pobjUID, __GO_X_AXIS_TICKS_LABELS__, userLabels, jni_string_vector, nbTicsRow * nbTicsCol);
}
else
{
int* piTicksStyle = &iTicksStyle;
char ticksStyle = 0;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "xtics_coord");
return SET_PROPERTY_ERROR;
if (piXNumberTicks == NULL)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"xtics_coord");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "xtics_coord");
return SET_PROPERTY_ERROR;
}
if (status == FALSE)
{
FREE(coordsVector);
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"xtics_coord");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "xtics_coord");
return SET_PROPERTY_ERROR;
}
/*------------------------------------------------------------------------*/
int set_y_location_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
- BOOL status = FALSE;
- int axisLocation = 0;
+ BOOL status = FALSE;
+ int axisLocation = 0;
- if ( !isParameterStringMatrix( valueType ) )
- {
- Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "y_location");
- return SET_PROPERTY_ERROR ;
- }
+ if ( !( valueType == sci_strings ) )
+ {
+ Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "y_location");
+ return SET_PROPERTY_ERROR ;
+ }
- if ( isStringParamEqual( stackPointer, "left" ) )
- {
- axisLocation = 4;
- }
- else if ( isStringParamEqual( stackPointer, "right" ) )
- {
- axisLocation = 5;
- }
- else if ( isStringParamEqual( stackPointer, "middle" ) )
- {
- axisLocation = 2;
- }
- else if ( isStringParamEqual( stackPointer, "origin" ) )
- {
- axisLocation = 3;
- }
- else
- {
- Scierror(999, _("Wrong value for '%s' property: Must be in the set {%s}.\n"), "y_location", "left, right, middle, origin");
- return SET_PROPERTY_ERROR ;
- }
+ if ( isStringParamEqual( stackPointer, "left" ) )
+ {
+ axisLocation = 4;
+ }
+ else if ( isStringParamEqual( stackPointer, "right" ) )
+ {
+ axisLocation = 5;
+ }
+ else if ( isStringParamEqual( stackPointer, "middle" ) )
+ {
+ axisLocation = 2;
+ }
+ else if ( isStringParamEqual( stackPointer, "origin" ) )
+ {
+ axisLocation = 3;
+ }
+ else
+ {
+ Scierror(999, _("Wrong value for '%s' property: Must be in the set {%s}.\n"), "y_location", "left, right, middle, origin");
+ return SET_PROPERTY_ERROR ;
+ }
- status = setGraphicObjectProperty(pobjUID, __GO_Y_AXIS_LOCATION__, &axisLocation, jni_int, 1);
+ status = setGraphicObjectProperty(pobjUID, __GO_Y_AXIS_LOCATION__, &axisLocation, jni_int, 1);
- if (status == TRUE)
- {
- return SET_PROPERTY_SUCCEED;
- }
- else
- {
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"y_location");
- return SET_PROPERTY_ERROR;
- }
+ if (status == TRUE)
+ {
+ return SET_PROPERTY_SUCCEED;
+ }
+ else
+ {
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "y_location");
+ return SET_PROPERTY_ERROR;
+ }
}
/*------------------------------------------------------------------------*/
int iNumElements = 0;
int* piNumElements = &iNumElements;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "y_shift");
return SET_PROPERTY_ERROR;
if (piNumElements == NULL)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"y_shift");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "y_shift");
return SET_PROPERTY_ERROR;
}
return SET_PROPERTY_ERROR;
}
- if( nbElement != 0 )
+ if ( nbElement != 0 )
{
- shiftCoordinates = (double*) getDoubleMatrixFromStack(stackPointer);
+ shiftCoordinates = (double*) stk(stackPointer);
result = setGraphicObjectProperty(pobjUID, __GO_DATA_MODEL_Y_COORDINATES_SHIFT__, shiftCoordinates, jni_double_vector, iNumElements);
/* The FALSE value is used for now to identify a failed memory allocation */
if (result == FALSE)
{
- Scierror(999, _("%s: No more memory.\n"),"set_y_shift_property");
+ Scierror(999, _("%s: No more memory.\n"), "set_y_shift_property");
return SET_PROPERTY_ERROR;
}
}
#include "DrawObjects.h"
#include "freeArrayOfString.h"
#include "loadTextRenderingAPI.h"
+#include "sci_types.h"
#include "setGraphicObjectProperty.h"
#include "graphicObjectProperties.h"
double* userGrads = NULL;
char** userLabels = NULL;
- if ( !isParameterTlist( valueType ) )
+ if ( !(valueType == sci_tlist ))
{
Scierror(999, _("Wrong type for '%s' property: Typed list expected.\n"), "y_ticks");
return SET_PROPERTY_ERROR ;
if ( userGrads == NULL && nbTicsRow == -1 )
{
- Scierror(999, _("%s: No more memory.\n"),"set_y_ticks_property");
+ Scierror(999, _("%s: No more memory.\n"), "set_y_ticks_property");
return SET_PROPERTY_ERROR ;
}
setGraphicObjectProperty(pobjUID, __GO_Y_AXIS_AUTO_TICKS__, &autoTicks, jni_bool, 1);
- status = setGraphicObjectProperty(pobjUID, __GO_Y_AXIS_TICKS_LOCATIONS__, userGrads, jni_double_vector, nbTicsRow*nbTicsCol);
+ status = setGraphicObjectProperty(pobjUID, __GO_Y_AXIS_TICKS_LOCATIONS__, userGrads, jni_double_vector, nbTicsRow * nbTicsCol);
if (status == FALSE)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"y_ticks");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "y_ticks");
FREE(userGrads);
return SET_PROPERTY_ERROR;
}
// We need to check the size to not be 0 because an empty matrix is a matrix of double
// and 'getCurrentStringMatrixFromList' expect a matrix of string (see bug 5148).
// P.Lando
- if( nbTicsCol * nbTicsRow )
+ if ( nbTicsCol * nbTicsRow )
{
userLabels = getCurrentStringMatrixFromList( tlist, &nbTicsRow, &nbTicsCol );
/* Check if we should load LaTex / MathML Java libraries */
loadTextRenderingAPI(userLabels, nbTicsCol, nbTicsRow);
- setGraphicObjectProperty(pobjUID, __GO_Y_AXIS_TICKS_LABELS__, userLabels, jni_string_vector, nbTicsRow*nbTicsCol);
+ setGraphicObjectProperty(pobjUID, __GO_Y_AXIS_TICKS_LABELS__, userLabels, jni_string_vector, nbTicsRow * nbTicsCol);
}
else
{
int* piTicksStyle = &iTicksStyle;
char ticksStyle = 0;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "ytics_coord");
return SET_PROPERTY_ERROR;
if (piYNumberTicks == NULL)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"ytics_coord");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "ytics_coord");
return SET_PROPERTY_ERROR;
}
if (status == FALSE)
{
FREE(coordsVector);
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"ytics_coord");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "ytics_coord");
return SET_PROPERTY_ERROR;
}
int set_z_bounds_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
BOOL status = FALSE;
- double * values = getDoubleMatrixFromStack( stackPointer );
+ double * values = stk( stackPointer );
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "z_bounds");
return SET_PROPERTY_ERROR;
}
else
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"z_bounds");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "z_bounds");
return SET_PROPERTY_ERROR;
}
}
int iNumElements = 0;
int* piNumElements = &iNumElements;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "z_shift");
return SET_PROPERTY_ERROR;
if (piNumElements == NULL)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"z_shift");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "z_shift");
return SET_PROPERTY_ERROR;
}
return SET_PROPERTY_ERROR;
}
- if( nbElement != 0 )
+ if ( nbElement != 0 )
{
- shiftCoordinates = (double*) getDoubleMatrixFromStack(stackPointer);
+ shiftCoordinates = (double*) stk(stackPointer);
result = setGraphicObjectProperty(pobjUID, __GO_DATA_MODEL_Z_COORDINATES_SHIFT__, shiftCoordinates, jni_double_vector, iNumElements);
/* The FALSE value is used for now to identify a failed memory allocation */
if (result == FALSE)
{
- Scierror(999, _("%s: No more memory.\n"),"set_z_shift_property");
+ Scierror(999, _("%s: No more memory.\n"), "set_z_shift_property");
return SET_PROPERTY_ERROR;
}
}
#include "DrawObjects.h"
#include "freeArrayOfString.h"
#include "loadTextRenderingAPI.h"
+#include "sci_types.h"
#include "setGraphicObjectProperty.h"
#include "graphicObjectProperties.h"
double* userGrads = NULL;
char** userLabels = NULL;
- if ( !isParameterTlist( valueType ) )
+ if ( !( valueType == sci_tlist ))
{
Scierror(999, _("Wrong type for '%s' property: Typed list expected.\n"), "z_ticks");
return SET_PROPERTY_ERROR ;
if ( userGrads == NULL && nbTicsRow == -1 )
{
// if nbTicsRow = 0, it's just an empty matrix
- Scierror(999, _("%s: No more memory.\n"),"set_z_ticks_property");
+ Scierror(999, _("%s: No more memory.\n"), "set_z_ticks_property");
return SET_PROPERTY_ERROR ;
}
setGraphicObjectProperty(pobjUID, __GO_Z_AXIS_AUTO_TICKS__, &autoTicks, jni_bool, 1);
- status = setGraphicObjectProperty(pobjUID, __GO_Z_AXIS_TICKS_LOCATIONS__, userGrads, jni_double_vector, nbTicsRow*nbTicsCol);
+ status = setGraphicObjectProperty(pobjUID, __GO_Z_AXIS_TICKS_LOCATIONS__, userGrads, jni_double_vector, nbTicsRow * nbTicsCol);
if (status == FALSE)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"z_ticks");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "z_ticks");
FREE(userGrads);
return SET_PROPERTY_ERROR;
}
// We need to check the size to not be 0 because an empty matrix is a matrix of double
// and 'getCurrentStringMatrixFromList' expect a matrix of string (see bug 5148).
// P.Lando
- if( nbTicsCol * nbTicsRow )
+ if ( nbTicsCol * nbTicsRow )
{
userLabels = getCurrentStringMatrixFromList( tlist, &nbTicsRow, &nbTicsCol );
/* Check if we should load LaTex / MathML Java libraries */
loadTextRenderingAPI(userLabels, nbTicsCol, nbTicsRow);
- setGraphicObjectProperty(pobjUID, __GO_Z_AXIS_TICKS_LABELS__, userLabels, jni_string_vector, nbTicsRow*nbTicsCol);
+ setGraphicObjectProperty(pobjUID, __GO_Z_AXIS_TICKS_LABELS__, userLabels, jni_string_vector, nbTicsRow * nbTicsCol);
}
else
{
{
char* type = NULL;
- if ( !isParameterDoubleMatrix( valueType ) )
+ if ( !( valueType == sci_matrix ) )
{
Scierror(999, _("Wrong type for '%s' property: Real matrix expected.\n"), "zoom_box");
return SET_PROPERTY_ERROR;
if (strcmp(type, __GO_AXES__) != 0)
{
- Scierror(999, _("'%s' property does not exist for this handle.\n"),"zoom_box");
+ Scierror(999, _("'%s' property does not exist for this handle.\n"), "zoom_box");
return SET_PROPERTY_ERROR;
}
/* We must have a 4x1 matrix */
if ( nbRow * nbCol == 6 )
{
- return sciZoom3D(pobjUID, getDoubleMatrixFromStack(stackPointer));
+ return sciZoom3D(pobjUID, stk(stackPointer));
}
- else if( nbRow * nbCol == 4)
+ else if ( nbRow * nbCol == 4)
{
- return sciZoom2D(pobjUID, getDoubleMatrixFromStack(stackPointer));
+ return sciZoom2D(pobjUID, stk(stackPointer));
}
else if ( nbCol * nbRow == 0 )
{
if (fractionAdr != 0)
{
- iValue = (int)(getDoubleFromStack(fractionAdr) * 100);
+ iValue = (int)(*(stk(fractionAdr)) * 100);
setGraphicObjectProperty(pWaitbarUID, __GO_UI_VALUE__, &iValue, jni_int, 1);
}
else if (messageAdr != NULL)
GraphicHandle = getHandle(pWaitbarUID);
- iValue = (int)(getDoubleFromStack(fractionAdr) * 100);
+ iValue = (int)(*(stk(fractionAdr)) * 100);
setGraphicObjectProperty(pWaitbarUID, __GO_UI_VALUE__, &iValue, jni_int, 1);
setGraphicObjectProperty(pWaitbarUID, __GO_UI_MESSAGE__, getStringMatrixFromStack((size_t) messageAdr), jni_string_vector,
nbColMessage * nbRowMessage);
return FALSE;
}
- GraphicHandle = (unsigned long)*hstk(handleAdr);
+ GraphicHandle = (unsigned long) * hstk(handleAdr);
pWaitbarUID = (char*)getObjectFromHandle(GraphicHandle);
if (pWaitbarUID == NULL)
{
return FALSE;
}
- iValue = (int)(getDoubleFromStack(fractionAdr) * 100);
+ iValue = (int)(*(stk(fractionAdr)) * 100);
setGraphicObjectProperty(pWaitbarUID, __GO_UI_VALUE__, &iValue, jni_int, 1);
}
else if (VarType(1) == sci_strings && VarType(2) == sci_handles) /* waitbar(mes,winId) */
return FALSE;
}
- GraphicHandle = (unsigned long)*hstk(handleAdr);
+ GraphicHandle = (unsigned long) * hstk(handleAdr);
pWaitbarUID = (char*)getObjectFromHandle(GraphicHandle);
if (pWaitbarUID == NULL)
{
return FALSE;
}
- GraphicHandle = (unsigned long)*hstk(handleAdr);
+ GraphicHandle = (unsigned long) * hstk(handleAdr);
pWaitbarUID = (char*)getObjectFromHandle(GraphicHandle);
if (pWaitbarUID != NULL)
{
- iValue = (int)(getDoubleFromStack(fractionAdr) * 100);
+ iValue = (int)(*(stk(fractionAdr)) * 100);
setGraphicObjectProperty(pWaitbarUID, __GO_UI_VALUE__, &iValue, jni_int, 1);
setGraphicObjectProperty(pWaitbarUID, __GO_UI_MESSAGE__, getStringMatrixFromStack((size_t) messageAdr), jni_string_vector,
nbColMessage * nbRowMessage);
if (VarType(1) == sci_matrix)
{
GetRhsVar(1, MATRIX_OF_DOUBLE_DATATYPE, &nbRowDefaultValues, &nbColDefaultValues, &defaultValuesAdr);
- defaultValues = getDoubleMatrixFromStack(defaultValuesAdr);
+ defaultValues = stk(defaultValuesAdr);
defaultValuesInt = (int *)MALLOC(nbRowDefaultValues * nbColDefaultValues * sizeof(int));
for (K = 0; K < nbRowDefaultValues * nbColDefaultValues; K++)
#include "CallScilabBridge.hxx"
extern "C"
{
+#include "stack-c.h"
#include "sci_types.h"
#include "BOOL.h"
#include "getScilabJavaVM.h"
if (valueType == sci_matrix)
{
// The parent is Scilab Main window (Console Tab)
- value = getDoubleMatrixFromStack(stackPointer);
+ value = stk(stackPointer);
if (value[0] != 0)
{
Scierror(999, const_cast < char *>(_("%s: Wrong value for parent: 0 expected.\n")), "SetMenuParent");
*/
#include "SetUicontrolBackgroundColor.hxx"
-
+#include "stack-c.h"
int SetUicontrolBackgroundColor(void* _pvCtx, char* sciObjUID, size_t stackPointer, int valueType, int nbRow, int nbCol)
{
/* Color can be [R, G, B] or "R|G|B" */
if (valueType == sci_strings)
{
- if(nbCol != 1 || nbRow == 0)
+ if (nbCol != 1 || nbRow == 0)
{
- /* Wrong string size */
- Scierror(999, const_cast<char*>(_("Wrong size for '%s' property: 1 x 3 real vector or a 'R|G|B' string expected.\n")), "BackgroundColor");
- return SET_PROPERTY_ERROR;
+ /* Wrong string size */
+ Scierror(999, const_cast<char*>(_("Wrong size for '%s' property: 1 x 3 real vector or a 'R|G|B' string expected.\n")), "BackgroundColor");
+ return SET_PROPERTY_ERROR;
}
- allColors = new double[3];
- nbValues = sscanf(getStringFromStack(stackPointer), "%lf|%lf|%lf", &allColors[0], &allColors[1], &allColors[2]);
+ allColors = new double[3];
+ nbValues = sscanf(getStringFromStack(stackPointer), "%lf|%lf|%lf", &allColors[0], &allColors[1], &allColors[2]);
- if (nbValues != 3)
+ if (nbValues != 3)
{
- /* Wrong string format */
- Scierror(999, const_cast<char*>(_("Wrong value for '%s' property: 1 x 3 real vector or a 'R|G|B' string expected.\n")), "BackgroundColor");
- return SET_PROPERTY_ERROR;
+ /* Wrong string format */
+ Scierror(999, const_cast<char*>(_("Wrong value for '%s' property: 1 x 3 real vector or a 'R|G|B' string expected.\n")), "BackgroundColor");
+ return SET_PROPERTY_ERROR;
}
}
else if (valueType == sci_matrix)
{
- if(nbCol != 3 || nbRow != 1)
+ if (nbCol != 3 || nbRow != 1)
{
/* Wrong matrix size */
Scierror(999, const_cast<char*>(_("Wrong size for '%s' property: 1 x 3 real vector or a 'R|G|B' string expected.\n")), "BackgroundColor");
return SET_PROPERTY_ERROR;
}
- allColors = getDoubleMatrixFromStack(stackPointer);
+ allColors = stk(stackPointer);
}
else
*/
#include "SetUicontrolPosition.hxx"
+#include "stack-c.h"
int SetUicontrolPosition(char *sciObjUID, size_t stackPointer, int valueType, int nbRow, int nbCol)
{
return SET_PROPERTY_ERROR;
}
- position = getDoubleMatrixFromStack(stackPointer);
+ position = stk(stackPointer);
}
else
*/
#include "SetUicontrolSliderStep.hxx"
+#include "stack-c.h"
int SetUicontrolSliderStep(void* _pvCtx, char* sciObjUID, size_t stackPointer, int valueType, int nbRow, int nbCol)
{
return SET_PROPERTY_ERROR;
}
- if( nbRow == 1 && nbCol == 1)
+ if ( nbRow == 1 && nbCol == 1)
{
double pdblStep[2];
- double* pdblStackVal = getDoubleMatrixFromStack(stackPointer);
+ double* pdblStackVal = stk(stackPointer);
pdblStep[0] = pdblStackVal[0];
pdblStep[1] = 0.1;// default big value : 10%
-
+
status = setGraphicObjectProperty(sciObjUID, const_cast<char*>(__GO_UI_SLIDERSTEP__), pdblStep, jni_double_vector, 2);
}
- else if(nbRow == 1 && nbCol == 2)
+ else if (nbRow == 1 && nbCol == 2)
{
- status = setGraphicObjectProperty(sciObjUID, const_cast<char*>(__GO_UI_SLIDERSTEP__), getDoubleMatrixFromStack(stackPointer), jni_double_vector, 2);
+ status = setGraphicObjectProperty(sciObjUID, const_cast<char*>(__GO_UI_SLIDERSTEP__), stk(stackPointer), jni_double_vector, 2);
}
else
{
#include <math.h>
#include "SetUicontrolValue.hxx"
+#include "stack-c.h"
int SetUicontrolValue(void* _pvCtx, char* sciObjUID, size_t stackPointer, int valueType, int nbRow, int nbCol)
{
return SET_PROPERTY_ERROR;
}
- value = getDoubleMatrixFromStack(stackPointer);
+ value = stk(stackPointer);
valueSize = nbCol * nbRow;
}
else if (valueType == sci_strings) // Ascendant compatibility
*/
#include "SetUiobjectForegroundColor.hxx"
-
+#include "stack-c.h"
int SetUiobjectForegroundColor(void* _pvCtx, char* sciObjUID, size_t stackPointer, int valueType, int nbRow, int nbCol)
{
/* Color can be [R, G, B] or "R|G|B" */
if (valueType == sci_strings)
{
- if(nbCol != 1 || nbRow == 0) /* More than one string */
+ if (nbCol != 1 || nbRow == 0) /* More than one string */
{
Scierror(999, const_cast<char*>(_("Wrong size for '%s' property: 1 x 3 real vector or a 'R|G|B' string expected.\n")), "ForegroundColor");
return SET_PROPERTY_ERROR;
}
else if (valueType == sci_matrix)
{
- if(nbCol != 3 || nbRow != 1) /* Wrong matrix size */
+ if (nbCol != 3 || nbRow != 1) /* Wrong matrix size */
{
Scierror(999, const_cast<char*>(_("Wrong size for '%s' property: 1 x 3 real vector or a 'R|G|B' string expected.\n")), "ForegroundColor");
return SET_PROPERTY_ERROR;
}
- allColors = getDoubleMatrixFromStack(stackPointer);
+ allColors = stk(stackPointer);
}
else
{