2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2004-2006 - INRIA - Fabrice Leray
4 * Copyright (C) 2006 - INRIA - Allan Cornet
5 * Copyright (C) 2006 - INRIA - Jean-Baptiste Silvy
6 * Copyright (C) 2009 - DIGITEO - Pierre Lando
7 * Copyright (C) 2011 - DIGITEO - Vincent COUVERT
9 * This file must be used under the terms of the CeCILL.
10 * This source file is licensed as described in the file COPYING, which
11 * you should have received as part of this distribution. The terms
12 * are also available at
13 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
17 /*------------------------------------------------------------------------*/
18 /* file: set_callback_type_property.c */
19 /* desc : function to modify in Scilab the callback_type field of */
21 /*------------------------------------------------------------------------*/
23 #include "setHandleProperty.h"
24 #include "getPropertyAssignedValue.h"
26 #include "localization.h"
27 #include "SetPropertyStatus.h"
29 #include "setGraphicObjectProperty.h"
30 #include "graphicObjectProperties.h"
32 /*------------------------------------------------------------------------*/
33 int set_callback_type_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
38 if ( !( valueType == sci_matrix ) )
40 Scierror(999, _("Wrong type for '%s' property: A Real scalar expected.\n"), "callback_type");
41 return SET_PROPERTY_ERROR;
45 Scierror(999, _("Wrong size for '%s' property: A Real scalar expected.\n"), "callback_type");
46 return SET_PROPERTY_ERROR;
49 callbackType = (int) getDoubleFromStack(stackPointer);
52 if (callbackType < -1 || callbackType > 2)
54 Scierror(999, _("Wrong value for '%s' property: %d, %d, %d or %d expected.\n"), "callback_type", -1, 0, 1, 2);
55 return SET_PROPERTY_ERROR;
58 status = setGraphicObjectProperty(pobjUID, __GO_CALLBACKTYPE__, &callbackType, jni_int, 1);
62 return SET_PROPERTY_SUCCEED;
66 Scierror(999, _("'%s' property does not exist for this handle.\n"), "callback_type");
67 return SET_PROPERTY_ERROR;
70 /*------------------------------------------------------------------------*/